Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-26 Thread Dorvin
W dniu 2014-09-25 13:54, Goswin von Brederlow pisze: It might help if you would post a testcase that: a) actualy compiles It actualy compiles on Windows. I think I should state it more clearly in first post. b) doesn't involve undefined behaviour: (ii) select() may update the

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-26 Thread Dorvin
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.

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-26 Thread Goswin von Brederlow
On Fri, Sep 26, 2014 at 09:51:40AM +0200, Dorvin wrote: W dniu 2014-09-25 13:54, Goswin von Brederlow pisze: It might help if you would post a testcase that: a) actualy compiles It actualy compiles on Windows. I think I should state it more clearly in first post. With the includes for

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-26 Thread Goswin von Brederlow
On Fri, Sep 26, 2014 at 09:55:59AM +0200, Dorvin wrote: 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

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-26 Thread Dorvin
W dniu 2014-09-26 10:39, Goswin von Brederlow pisze: a) actualy compiles It actualy compiles on Windows. I think I should state it more clearly in first post. With the includes for FD_SET missing and Sleep() undefined? I don't know what Windows version and which build environment you are

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-26 Thread Goswin von Brederlow
On Fri, Sep 26, 2014 at 11:25:37AM +0200, Dorvin wrote: W dniu 2014-09-26 10:39, Goswin von Brederlow pisze: a) actualy compiles It actualy compiles on Windows. I think I should state it more clearly in first post. With the includes for FD_SET missing and Sleep() undefined? I

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-25 Thread Dorvin
Thank you for your replies so far. I'll clarify if it does matter that I'm using Windows and libzmq 4.0.4. W dniu 2014-09-25 04:38, Goswin von Brederlow pisze: the ØMQ library shall signal any pending events on the socket in an edge-triggered fashion by making the file descriptor

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-25 Thread Goswin von Brederlow
On Thu, Sep 25, 2014 at 11:09:15AM +0200, Dorvin wrote: Thank you for your replies so far. I'll clarify if it does matter that I'm using Windows and libzmq 4.0.4. W dniu 2014-09-25 04:38, Goswin von Brederlow pisze: the ØMQ library shall signal any pending events on the socket in an

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-25 Thread KIU Shueng Chuan
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

[zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-24 Thread Dorvin
Hi, I started using ZeroMQ not long ago and tried to use it in evented app. When I try to use FD with socket notifier it appears I'm receiving ZMQ_POLLIN events when FD is signalling write event. Is there any rationale behind such behavior? Naive testcase to show this behavior is at:

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-24 Thread KIU Shueng Chuan
Don't check the FD for writability. You are only meant to check for its readability. ___ zeromq-dev mailing list zeromq-dev@lists.zeromq.org http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Re: [zeromq-dev] ZMQ_POLLIN received on WRITE event

2014-09-24 Thread Goswin von Brederlow
On Wed, Sep 24, 2014 at 07:51:39PM +0200, Dorvin wrote: Hi, I started using ZeroMQ not long ago and tried to use it in evented app. When I try to use FD with socket notifier it appears I'm receiving ZMQ_POLLIN events when FD is signalling write event. Is there any rationale behind such