Search code examples
c#network-programmingstream-socket-client

multiple clients streamsocketlistener


For a project I have to make an application that runs in a network. In this network there are 2 or more clients(streamsockets) connected to 1 server(streamsocketlistener). Is there a way to tell the server to receive data from one client and then sending it to the other client, instead of staying on the same connection?


Solution

  • Do you mean as in relay the data from one client to another via a third (i.e. server)? If so then this WPF client server chat example article demonstrates that. In particular see the comments within a method called HandleIncomingChatMessage, about half way down that article.