No, not per socket. One per port that accepts connections if you're a server, and one per host you're connecting to if you're a client.

On Monday, June 18, 2018, Vinnie Falco via Boost-users <boost-users@lists.boost.org> wrote:
On Mon, Jun 18, 2018 at 11:54 AM james via Boost-users
<boost-users@lists.boost.org> wrote:
> You want one io_service per endpoint, not per application.

What? No... You're saying a separate io_context for each socket?
That's not necessary. These are the common models:

* One io_context, one thread:
   - Implicit strand (no locks needed)

* One io_context, multiple threads
   - Explicit strand needed
   - Different sockets can process data concurrently

* One io_context for each thread
   - Implicit strand (no locks needed)
   - Sockets in different contexts can process data concurrently
   - Passing data between sockets in different contexts requires care
(e.g. broadcasts)

I know of no benefit to one io_context per socket, nor have I seen an
implementation which uses that model.

Thanks
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users