[zeromq-dev] full duplex asynch messaging

Jared White jaredkeithwhite at gmail.com
Sun Apr 10 06:45:33 CEST 2011


Martin Sustrik <sustrik <at> 250bpm.com> writes:

> However, if you have a bi-directional socket (such as P2P), you can poll 
> for IN & OUT and do the send/recv depending on the result.
> 
> Martin
> 


I know that this post is quite old, but I have a question regarding this method 
of polling.  

If I poll for OUT, won't it immediately return the event for that socket if it's 
able to be written without blocking?  

It seems like this would more or less act like a busy-wait.  You would poll, any 
socket that can write non-blocking would fire immediately, and we would then 
check the queue to identify if a message should be written.  In the event that 
there is no message to be written, we would re-enter the poll, which would fire 
immediately ...

Is my understanding of this ZMQ behavior correct?




More information about the zeromq-dev mailing list