You mean:

> send (s, msg);
> recv (s, msg) => EAGAIN
> poll (s);
> recv (s, msg) => OK
> recv (s, msg) => EAGAIN
> send (s, msg);
> recv (s, msg) => EAGAIN

poll (s);
> recv (s, msg) => OK
> recv (s, msg) => EAGAIN
>
> Right?

The issue is that the second EAGAIN is replaced by EFSM.

At least here's the way I understood it, please feel free to correct me:
1) right after sending a message, call recv immediately to reset the edge
triggering, otherwise select/epoll will never return.
2) after receiving a message with OK, call receive again to check if
there's anything else coming down the wire / reset the edge triggering.

I guess for req-rep, step number 2 may not be necessary (unless we want to
handle multi-part messages, which has a different check anyways) but the
general advice people have given on this list is to use a while loop when
recving.

I can write some example code with select/epoll if you'd like to test it
yourself.

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

Reply via email to