zeromq/libzmq — pull request #658 by ricnewton (2013-09-15 12:55:15+00:00)
Title: Support high water mark on inproc socket connect before bind.

We can now set hwm on sockets when connecting before bind on inproc.

There are a few issues left on this feature.

The biggest one is at the moment, if you connect an inproc, then close it and never bind a socket to that address the system hangs on terminate, looking into that one.

There is quite a bit of duplicate code between ctx.cpp and socket_base.cpp now, I was thinking to use the code in ctx.cpp and remove it from socket_base.cpp, could wait until after 4.0 is released though if wanted. This would also mean we could get rid of the race condition when a bind happens between a find_endpoint and pend_connection that we currently handle in pend_connection.

The final issue I can see is we still have an asymmetry between binding first and connecting first. If you connect first then send some messages before the bind the messages get buffered and sent on bind, if you bind first the messages get dropped. This is a bigger change to fix though, should wait until after 4.0.