I want to use "each io_service per worker thread" design in my program. But I cant reuse unix socket:
io_service io_1;
io_service io_2;
::unlink("/tmp/test");
stream_protocol::endpoint ep("/tmp/test");
stream_protocol::acceptor acceptor_1(io_1, ep, true);
stream_protocol::acceptor acceptor_2(io_2, ep, true);
io_1.run();
io_2.run();
fails with "address already in use". When I open my asio/basic_socket_acceptor.hpp (boost 1.46.1) I see description to acceptor's constructor:
This constructor creates an acceptor and automatically opens it to listen for new connections on the specified endpoint.
@param reuse_addr whether the constructor should set the socket option socket_base::reuse_address.
basic_socket_acceptor(boost::asio::io_service& io_service,
const endpoint_type& endpoint, bool reuse_addr = true)
This a boost asio bug and I should send it to the bugtracker, am I right?