I am using Boost asio 1.48. Is it possible to re-use a single boost::asio::io_service
instance for multiple listening sockets that are open simultaneously?
The docs say its share-safe, but I am not sure if that is already a positive answer.
Yes, you can, and you should. And you can use that same io_service
to handle those sockets, handle timers, handle requests you post
to it, and so on. The whole point of an io_service
is to act as a central dispatcher for work of all kinds.
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