Problem with socketpair , AF_UNIX and select call - can anybody through any light on this!

Howard Wilkinson howard at cohtech.com
Fri Oct 12 07:49:26 UTC 2007


I have a piece of code that is listening to multiple incoming 
communications channels over UDP and TCP. This code has set the sockets 
non-blocking and is using select with a time-out to detect when there is 
I-O traffic to process.

I wanted to add a socketpair connection from the master process to the 
servers which implement the actual functionality. I created the 
socketpair, set both ends non-blocking and added it to the select set of 
fd's. I get an immediate return saying that the socket is ready to read 
but when I issue a recv I get  -1 (EAGAIN). Nothing I have tried sets 
the required behaviour of only returning when there is 'real' data to read.

Anybody seen this, is it a known problem with Linux kernels? (I am 
currently running 2.6.22.9-91.fc7)

Is there a known work round. I am currently thinking of replacing the 
AF_UNIX socket pair with a mesh of  AF_INET/SOCK_DGRAM/localhost channels.

Regards, Howard.




More information about the fedora-list mailing list