[zeromq-dev] MSG_DONTWAIT on AIX/HP-UX

Martin Sustrik sustrik at fastmq.com
Tue Nov 11 16:51:50 CET 2008


>> because MSG_DONTWAIT doesn't exist on every system, currently we use
>> fcntl function to set socket to nonblocking mode. It can be found in
>> svn, revision 610. It uses O_NONBLOCK and it may not work correctly on
>> every aix version, although it is defined there. We don't have aix, so
>> we can't test it, but if you come across any bugs, please, let us know.
> 
> Unless I missed it, I believe this is a different path through the
> code.  In ysocketpair.hpp, there's a socketpair/recv call, the
> MSG_DONTWAIT flag from the recv call is the issue on AIX/HP-UX.  I
> believe the socketpair() (r,w) descriptors should become non blocking
> as well.  By doing this the MSG_DONTWAIT flag can be removed from the
> recv call.

Actually, the ysocketpair uses file descriptors created via POSIX 
socketpair function. What we need is blocking write to one of the 
sockets and non-blocking read on the other socket.

We can try to set one socket to non-blocking mode after the socketpair 
call, but I am not sure whether that would work well on all the 
platforms. We have to check that...

Martin



More information about the zeromq-dev mailing list