[zeromq-dev] socket writability and events

Pieter Hintjens ph at imatix.com
Fri Dec 14 23:46:09 CET 2012


Part 1. the behaviour isn't documented but what you suggest makes
sense. You should be able to reproduce it.

Part 2. not documented, again, would need to test to be sure.

Once we have reproducible cases we can see whether these are bugs to
fix, or expected effects to document.

-Pieter

On Fri, Dec 14, 2012 at 9:40 PM, Justin Karneges <justin at affinix.com> wrote:
> Hi,
>
> Is it possible that a socket could be determined to be writable but then
> actually isn't writable at the time of write? For example, say a connection
> exists on a bind socket and ZMQ_POLLOUT is indicated. But then just before
> calling zmq_send(), the connection is destroyed. A socket that was using bind
> should have no queue anymore, and therefore I would expect the send to
> actually block (or report EAGAIN). I just want to confirm this is indeed
> possible.
>
> Secondly, assuming the above is true, if you're doing an event loop
> integration and checking ZMQ_EVENTS after every call to zmq_send, do you still
> need to check the events even if zmq_send fails? My guess is that if it fails
> with EAGAIN, that you probably should check the events (especially if the
> reason you attempted a write in the first place is because ZMQ_POLLOUT was
> indicated prior). What I'm doing in my code now is checking events after
> success or EAGAIN, but not checking in any other case. Looking for confirmation
> on this as well.
>
> Thanks,
> Justin
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list