[zeromq-dev] ZMQ_POLLIN received on WRITE event

Dorvin dorvin at tlen.pl
Fri Sep 26 09:55:59 CEST 2014


W dniu 2014-09-26 02:05, KIU Shueng Chuan pisze:
> Your code could be stripped down a lot:
> 1) PUB socket is only for sending. There's no need to test it for
> ZMQ_POLLIN.
> 2) PUB socket never blocks when sending. There's no need to test it for
> ZMQ_POLLOUT.
> 3) SUB socket is only for receiving. There's no need to test it for
> ZMQ_POLLOUT.
> 4) The ZMQ_FDs are only to be tested for readability. They are NOT to be
> tested for writability (and in fact should always test positive for
> writability.)
>

You are right. My case isn't really "minimal" but allows to test on 
different types of sockets with just minimal changes.

I still feel not right about receiving POLLIN on write but it might just 
be my habit from old times of low level socket programming. You both 
made me start to think about 0mq in different way.


Thanks,
Jarek





More information about the zeromq-dev mailing list