> I'm agree with you, but on other *nix platforms, and even on Windows with
> winsock and AF_UNIX, connect() doesn't wait for accept(). I would like such
> behavior.

The behavior that connect() does not require accept() from the other end is 
platform-specific.
It's your other system's courtesy, actually, to acknowledge the connection 
before the user code calls accept().  But it is not guaranteed.

> setting SO_PEERCRED on the client socket works.

This is again a kludge, which is not designed (in general of what SO_PEERCRED 
is supposed to do) to address the situation above.  Yes, it makes it work, in 
this particular case on this particular platform (Cygwin), but it won't have 
the same effect on some other Unix platform that wants to get accept() in the 
user code and that doesn't ack the connection without it, otherwise.

$.02,

Anton Lavrentiev
Contractor NIH/NLM/NCBI


-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to