jchristn/WatsonWebsocket

Communication between clients

Closed this issue · 2 comments

hi, how can i do Communication between clients,pls help me, thks

pha3z commented

The Readme demonstrates how to setup a server to handle client connect, disconnect, and message received events.

You can also Send messages to clients.

Clients are identified by the ipPort string that is present on ClientConnectedEventArgs.

Its up to you to write your own code to manage multiple clients. You can use the ipPort string passed to the events as a way to identify clients. I suggest creating a Dictionary<string,YourClientHandlerObject> so that you can make your own handlers for each client as they connect and store them in the dictionary keyed on ipPort. This isn't the only way to do things, but its easy and works very well. It also performs fast.

ok,thanks for you reply, I will have try and use redis save all clients info