Unix Domain Socket Limitation?

Ken Brown kbrown@cornell.edu
Mon Nov 30 23:19:06 GMT 2020


On 11/30/2020 1:26 PM, Norton Allen wrote:
> On 11/30/2020 1:14 PM, Ken Brown wrote:
>> I can reproduce the hang, and it happens if I use the new AF_UNIX code also. 
>> But what I'm seeing (at least with the new code) isn't exactly what you describe.
>>
>> When the server's first select call returns, accept succeeds.  The server then 
>> calls select a second time, and that call doesn't return. I haven't checked 
>> yet to see what's going on in the client, and I may not get to that for a while.
>>
> That's good news, and seems to be consistent with my theory that it is some sort 
> of race condition that might be particularly sensitive to system-specific 
> timing. I am compiling cygwin1.dll now.

Hi Norton,

I think there's a mistake in your test program.  Shouldn't client_pselect() be 
waiting for the socket to be write-ready rather than read-ready?  Here's a quote 
from the Posix page for 'connect':

If the connection cannot be established immediately and O_NONBLOCK is set for 
the file descriptor for the socket, connect() shall fail and set errno to 
[EINPROGRESS], but the connection request shall not be aborted, and the 
connection shall be established asynchronously....

When the connection has been established asynchronously, pselect(), select(), 
and poll() shall indicate that the file descriptor for the socket is ready for 
writing.

Ken


More information about the Cygwin mailing list