Coder Social home page Coder Social logo

chatting_program's Introduction

chatting_program_server

chatting_program using socket & multiThread

개요

  • socket을 활용한 클라이언트,서버 1:1 채팅 프로그램
  • accpet는 새로운 스레드를 할당하여 담당

주요 사항

  • 채팅 프로그램에 대해 고민해봤을 때 꼭 상대가 보낸 메세지를 읽은 후 내 메세지를 작성할 필요가 없다.
  • 즉 send thread / receive thread를 따로 두는 것도 좋다고 생각

동작

  • 서버는 port만 지정해줬기 때문에 inetAddrAny처럼 host컴퓨터 ip사용
    1. 서버 start
    1. 클라이언트 start - 서버(여기선 localhost)로 connect
    1. 먼저 입력하는 쪽이 먼저 send
    1. quit을 입력하기 전까지 진행 ...

ex

    1. 서버 먼저 메세지 입력
    • 화면 캡처 2021-12-17 032440
    1. 클라이언트 화면 및 답장 send
    • 화면 캡처 2021-12-17 032501
    1. 서버에서 클라이언트가 보낸 메세지 확인
    • 화면 캡처 2021-12-17 032513

chatting_program's People

Contributors

skarltjr avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.