Skip to content

Instantly share code, notes, and snippets.

@ghoshbishakh
Created August 9, 2017 16:16
Show Gist options
  • Save ghoshbishakh/0323e8f393cc61e9002f061686c139bb to your computer and use it in GitHub Desktop.
Save ghoshbishakh/0323e8f393cc61e9002f061686c139bb to your computer and use it in GitHub Desktop.

Each client will broadcast its own IP, NICK and TIMESTAMP along with its own peerList in every T seconds.

Each client will be maintaining its own peerList by listening to thsese broadcasts.

Peer expiry will not be there.

In case of duplicate NICKS are fine (as it cannot be stopped).

In case of same IP and 2 different NICKS, the old NICK will be replaced by the newer one.


For chat, any client N1 can open a TCP connection with any other node N2. The peers will have a definite PORT for this app (let 44444) as a listening port.

The client sending the first chat will act as client (obviously), and that incoming connection will be mapped with the IP, NICK so that the same connection can be used by both N1 and N2.

We plan to exchange ASCII for now. But emoji support is a must.


@Compro-Prasad
Copy link

and that incoming connection will be mapped ...
The incoming connection? On N1 side or N2 side or both of them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment