Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT cygwin DOT com Delivered-To: mailing list cygwin-developers AT cygwin DOT com X-Authentication-Warning: atacama.four-d.de: mail set sender to using -f Date: Tue, 25 Feb 2003 14:53:41 +0100 (=?ISO-8859-1?Q?Westeurop=E4ische_Normalzeit?=) From: Thomas Pfaff To: cygwin-developers AT cygwin DOT com Subject: Re: Interruptable connect In-Reply-To: <20030225121251.GF8853@cygbert.vinschen.de> Message-ID: X-X-Sender: pfaff AT antarctica DOT intern DOT net MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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