On 08/09/2013 08:34 PM, Damien Kick wrote:
The reason why there is a assign, but no release-function for boost::asio::ip::tcp::sockets is that once a socket is "bound" to a completion port you cannot "unbound" it or "bound" it to another completion-port.
I nearly forgot this one. You have to make sure that the Boost.Asio socket does not close the underlying socket. Here is an explanation of how it can be done: http://lists.zeromq.org/pipermail/zeromq-dev/2011-May/011666.html I used to use this technique in an Asio wrapper for ZeroMQ and it works just fine. However, I got dissatisfied by how ZeroMQ hides too much detail from me (like disconnect, so I cannot do things like Wake-on-LAN.) So I ended up writing a (partial) implementation of the ZMTP/2.0 protocol directly with Asio: http://axiomq.sourceforge.net/