Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Mon, 16 Jul 2001 09:52:58 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: data in socketpair() channel lost if writer closes or exits without shutting down Message-ID: <20010716095258.P25442@cygbert.vinschen.de> Mail-Followup-To: cygwin AT cygwin DOT com References: <20010713181435 DOT 3695 DOT qmail AT lizard DOT curl DOT com> <20010713202146 DOT B11377 AT redhat DOT com> <20010716025220 DOT 23701 DOT qmail AT lizard DOT curl DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010716025220.23701.qmail@lizard.curl.com>; from jik@curl.com on Sun, Jul 15, 2001 at 10:52:20PM -0400 On Sun, Jul 15, 2001 at 10:52:20PM -0400, Jonathan Kamens wrote: > > Date: Fri, 13 Jul 2001 20:21:46 -0400 > > From: Christopher Faylor > > > > Thanks for the diagnosis. Would you be willing to look at the > > Cygwin socket code and suggest a fix? > > In yet another astounding piece of Windows brain-damage, the > *documented* behavior of the Winsock closesocket call is that any data > written to the socket that hasn't been read by the other end is lost, > and thus a client *must* call shutdown on a socket before closing it > to ensure that all data is transmitted to the other end. The Thanks for figuring that out. I would be very interested in this piece of documentation. Could you give me a pointer? The problem is, from what I read so far (which is basically the MSDN) the default behaviour on closing a socket is to perform a graceful shutdown with immediate return of the `closesocket' function (linger "off"). I just have that page "Graceful Shutdown, Linger Options, and Socket Closure" inside of MSDN, that's all. Since Microsoft at least claims that linger "off" is a valid and settable state, shouldn't we try a very simple solution first? We could change the Cygwin internal `socket' function so that we don't rely on the linger setting but set linger "off" explicitely after the socket() call. We could even set it explicitely in a WSADuplicateSocket/WSASocket action on fork. Comments? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/