I am implementing a game in a WPF application. I need to connect at least 10 players to a server. I have always worked with only one TcpClient
and one TcpListener
. Is there any way to connect a lot of clients to a server? I tried to create one thread per connection, but did not work. I have searched and I couldn`t find a simple example that could teach me how to do it.
Take a look at http://csharp.net-informations.com/communications/csharp-multi-threaded-server-socket.htm
If you scroll to the bottom there are other available examples, such as a TCP chat server/client which might be helpful.