This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: Interruptable connect
- From: Thomas Pfaff <tpfaff at gmx dot net>
- To: cygwin-developers at cygwin dot com
- Date: Tue, 25 Feb 2003 14:53:41 +0100 (Westeuropäische Normalzeit)
- Subject: Re: Interruptable connect
On Tue, 25 Feb 2003, Corinna Vinschen wrote:
> Hi Thomas,
>
> could we discuss this issue again? Do we have any problem to get all
> required information on a socket which would keep us from closing it
> and reopen a new one in the same (but unconnected) state?
>
Corinna,
i think that it is possible to restore all required socket options.
Following socket options can be read by getsockopt and restored via
setsockopt:
SO_DEBUG
SO_REUSEADDR
SO_KEEPALIVE
SO_DONTROUTE
SO_BROADCAST
SO_LINGER
SO_OOBINLINE
SO_DONTLINGER
SO_SNDBUF
SO_RCVBUF
TCP_NODELAY
SO_ERROR seems to be difficult because setsockopt does not allow to set
it (and i don't know which error should be set after an interrupted
connect. Maybe you could check this on Linux).
All flags set by fcntl must be restored.
Following options seems to be unsupported by Winsock (and i suppose that
they are unsupported by cygwin too).
SO_USELOOPBACK
SO_SNDLOWAT
SO_RCVLOWAT
SO_SNDTIMEO
SO_RCVTIMEO
And of course if the socket is already bound the socket address must be
restored. This should be possible by using SO_REUSEADDR after the original
socket has been closed.
Thomas