Robert> Does the TCP spec actually mandate that accept(2), or
Robert> the equivalent, not return until the entire three-way
Robert> handshake is complete? Are there TCP stacks with
Robert> different behavior?
The TCP specification does not mandate any API behaviour; However, all BSD
derived implementations that I know of use this behavious by default. Solaris
2.2 and above do allow you to change this behaviour by using ndd to change
one of variables for /dev/tcp (I think the variable is
tcp_old_urp_interpretation, but the only place it's documented is in
"TCP Illustrated", which is at home.)
I don't think there's an interface to this functionality through the sockets
API, but I hope I'm mistaken. There's definitely support for this in the
TLI interface, which has a two stage accept mechanism - normally this is
just obnoxious brain-damage, but it might be useful for debugging purposes
in cases like this.
Simon