Casey Marshall wrote: > Jeroen Frijters wrote: >> - PlainSocketImpl.connect should simply call >> impl.connect(address,timeout) which in turn calls >> channel.connect(address,timeout), the decision how to implement the >> timeout should be in the VM layer. > > Good point. >
The current version (setting SO_TIMEOUT) also won't work in practice. That method sets the SO_RCVTIMEO socket option, not SO_SNDTIMEO, which is the one that should be set, AFAICT. I don't know if that actually works, though. Stevens says to use SIGALRM for this, which I doubt will work here; others recommend putting the socket into nonblocking mode, then use select.