Allow blocking while connect() is completing

This patch, salvaged from a trainwreck accidental merge earlier, adds a
new sockopt, ZMQ_DELAY_ATTACH_ON_CONNECT which prevents a end point
being available to push messages to until it has fully connected, making
connect work more like bind. This also applies to reconnecting sockets,
which may cause message loss of in-queue messages, so it is sensible to
use this in conjunction with a low HWM and potentially an alternative
acknowledgement path.

Notes on most of the individual commits can be found the repository log.
This commit is contained in:
Ian Barber
2012-06-12 15:34:48 +01:00
parent 409d5e8fff
commit e5904e63ce
11 changed files with 117 additions and 25 deletions

View File

@@ -103,6 +103,9 @@ namespace zmq
// Pipe connecting the session to its socket.
zmq::pipe_t *pipe;
// This set is added to with pipes we are disconnecting, but haven't yet completed
std::set<pipe_t *> incomplete_pipes;
// This flag is true if the remainder of the message being processed
// is still in the in pipe.