[zeromq-dev] SNDTIMEO and REQ

Andrew Fister andrewfister3 at gmail.com
Sun Jun 29 11:35:10 CEST 2014


Greetings,
   I am currently implementing a REQ-ROUTER pattern with pyzmq and I wish
to use the SNDTIMEO and RCVTIMEO options in combination with REQ_RELAXED in
order to implement something similar to a lazy pirate pattern on the REQ
client. It doesn't quite seem to work for a few reasons, which taken
together foil my plans. Importantly, I am testing the client socket with no
server running, to simulate a broken connection.

1) In order for REQ_RELAXED to work, I must call connect to reconnect the
socket each time the REQ state goes bad, otherwise I cannot communicate
with the server. Not a problem by itself, but,

2) The first call to the REQ socket's send method after a connect call(with
broken connection):
  a) Ignores the SNDTIMEO option's timeout.
  b) Always returns successfully (None value in python)

Subsequent calls to the send method behave properly. Since it always
returns successfully the first time, it's hard to tell what actually
happened with the send. Here's a minimal example:

http://pastebin.com/tNdErEUQ

I'd appreciate any suggestions as to what I'm missing or workarounds for my
situation. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140629/ceab2626/attachment.htm>


More information about the zeromq-dev mailing list