Good evening everyone, I need to implement a server, and so many clients can connect to it, how can I do this? I work with the Socket class, I did this but only 1 connection, 1 server = 1 client, and I would like 1 server = 100 clients (approximately)
At what level did the question arise? In general, in the simplest case, you can create one serving thread per one incoming connection. For something heavily loaded, it makes sense to use BeginAccept / EndAccept method pairs in the stream that accepts incoming connections and BeginReceive / EndReceive in the serving thread.
The general principle remains the same: after connecting the first client, continue to listen to incoming connections in parallel with the first one.