I'm used to using boost::asio::ip::tcp::socket
s where I construct them with an io_service
. This has been useful because I have a single io_service
for all sockets and these sockets share a threadpool.
Now, I'm trying to work with a boost::asio::ip::tcp::io_stream
, and I'd like it perform all asynchronous work in the same threadpool. However, it does not appear to be possible to construct a tcp::io_stream
with an external io_service
. The underlying socket does indeed use an internally initialized io_service. Is there a way for me to continue using my centrally managed io_service
with a tcp::io_stream
?
I'm using boost version 1.62.