[zeromq-dev] HWM and sockets blocking while in exceptional state
Massimiliano della Rovere
massimiliano.dellarovere at gmail.com
Mon Dec 19 17:34:51 CET 2011
Greetings,
I am writing you because I need some help with zmq for my personal project.
I am using zmq 3, because I understood (may be I am wrong) I need the
RECVHWM option in setsockopt.
Also I tell you I am using zmq from python; may be the python wrapping
imposes limitations.
I need two sockets, on different machines (so tcp transport is the
only choice), one acts as sender (the one that bind-s), the other as
receiver (the one that connect-s).
What I am striving to obtain is that the sender's send() blocks when
both the sender and the receiver enter exceptional state.
In my tests, I :
- run the 2 programs instantiating the sockets on the same machine
(read below);
- use DEALER sockets for both the sender and the receiver;
- set RECVHWM to 1 in the receiver;
- set SNDHWM to 1 in the sender;
but I successfully manage to send any number of messages from the
sender without reading any from the receiver.
Now having a both RECVHWM and SENDHWM set to 1, I expected that 1st
sent message would fill the "RECVHWM slot", the 2nd sent message would
fill the "SENDHWM slot" and a 3rd invocation of send() in the sender
would block (it's a DEALER socket, shouldn't it)?
The strange thing is that if I use a tcp:// or ipc:// transport, the
send() is not blocking, but trying with inproc:// transport the send
is (correctly) blocking.
Is this difference in behaviour correct? Is the RECVHWM only working
with inproc transport?
Would your answer change if the sender performs a connect() and the
receiver a bind() ?
------------
skype: masdero, icq: 473891447, yim: mas_dero, msn: mas_dero at hotmail.com
More information about the zeromq-dev
mailing list