[zeromq-dev] Usage of POLLOUT on stream sockets

Bob Eby ebyrob at gmail.com
Wed Jul 10 12:31:36 CEST 2019


Dear Nils,

> I would like to connect my ZeroMQ application with a
> non-zeromq one via a ZMQ_STREAM socket type.

I think, in my way of looking at it, that you wouldn't be connecting
to a non-zeromq application.  Instead, you'd be writing your own
implementation of the zeromq protocol in order to communicate with the
zeromq library over (part of) the zeromq protocol.

Why would you need to re-write zeromq?  Certainly, it will be
educational...  But I'm not sure I could recommend this scenario in
any conceivable production setting.

> Is it possible to test if the socket is writable and a send
> would not block via the usage of poll (with POLLOUT)?

I've really only used REQ / REP with DEALER / BROKER myself.  I can
say that in my configuration ZeroMQ will definitely block on certain
calls.  Most notably, all data must be completely sent before the
remote side will begin reading any result.  I think this is partly
fundamental to how "queuing" works in ZeroMQ.  Some level of data
chunk will always be fully completed and secured (usually at message
level) before the remote end can begin to dequeue that chunk.

Someone please correct me if I'm wrong here.  I have not read the code!

Good luck with your configuration,
Robert E.



More information about the zeromq-dev mailing list