I'm trying to make a server that receives many connections and handle it. I think it's better if i put each connection in a thread, but I don't know how to do it, cause i still don't know how i tell my class "i receive a new connection, put it into a thread". I'm very confused and still don't found it in none of other posts here. Please, help me.
obs.: I had a hint which create a bunch of connections and so wait for the client, but i don't want to do this, I want to create a connection only if there is someone trying to enter in my server.
The Boost::Asio documentation's asynchronous TCP daytime server tutorial describes exactly how to write such a server.
Further, there are a number of multithreaded examples in among all the rest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With