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?

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to