I am not much experienced in boost::asio
. I've some pretty basic questions.
Do I need to have a different io_service
, and a different socket
under a different thread
but one single acceptor
, to process a client in a threaded server ?
I believe I must have a different socket for a new client. But if all threads use the same io_service
would it be parallel ?
I was going through http://en.highscore.de/cpp/boost/index.html in asio section which says I need to have different io_services in different threads to achieve parallelization.
I if I plan to make a Server class that creates a new TCPsession
each time a new client appears in acceptor.async_accept
and TCPSession
ctor creates an io_service
and a thread
and runs that io_service.run()
in its own thread would it be a good design ?
However in this design where would I join all these threads ? do I need another io_service
for main
so that it doesn't terminate even before getting a new Client ?