[zeromq-dev] HWM ignored on inproc connection
Douglas Creager
dcreager at dcreager.net
Sun Jan 2 22:43:01 CET 2011
I've attached a test case that shows the high-water mark being ignored on an inproc connection. The test program should block forever, since it sets an HWM of 2 on the PUSH socket, and then tries to send 3 messages. Instead, all 3 messages go through, and the test case runs to completion.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hwm.c
Type: application/octet-stream
Size: 1007 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110102/40890c12/attachment.obj>
-------------- next part --------------
It looks like the problem is in how the underlying pipes are created for inproc connections. The pipes aren't created until the zmq_connect call, and it uses the options from the connecting socket for both pipes. If you change the test case so that it calls setsockopt on the "in" socket (even though it's a PULL, and should therefore ignore its HWM), it blocks correctly.
I think zmq_connect should use the binding socket's options for the inbound pipe. I've attached a patch that does this. With this patch applied, the test cases blocks like it should.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Correct-HWM-and-SWAP-for-bind-side-of-inproc-connect.patch
Type: application/octet-stream
Size: 1274 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110102/40890c12/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: This is a digitally signed message part
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110102/40890c12/attachment.sig>
More information about the zeromq-dev
mailing list