delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/16/10:22:14

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3E9D66FF.E7C9EF48@precidia.com>
Date: Wed, 16 Apr 2003 10:21:51 -0400
From: Brian White <bcwhite AT precidia DOT com>
Organization: Precidia Technologies http://www.precidia.com/
X-Accept-Language: en
MIME-Version: 1.0
To: Max Bowsher <maxb AT ukf DOT net>
CC: cygwin AT cygwin DOT com
Subject: Re: tcp RST instead of FIN if child exits after parent closes path
References: <3E9C374E DOT 4256358D AT precidia DOT com> <004001c30372$9b95d9b0$235e893e AT pomello> <3E9C42AF DOT F8A6AEA1 AT precidia DOT com> <008701c30386$64cc56c0$5c51893e AT pomello> <3E9C73FB DOT F74E775A AT precidia DOT com> <009301c3039f$e1aef990$7999883e AT pomello>

> > I don't follow.  The path is still open and able to send the data from the
> > child even though the parent has closed it.  It's only when the child exits
> > (note: the child just exited; it didn't do an explicit "close") that the
> > connection was killed, so there the system already knows when the last close
> > occurs.  What is being done to the socket that is different depending upon
> > whether the final close comes from the process that originally opened it or
> > another one?
> 
> I believe it is not which process does the final close that matters. Rather,
> I think that it is write-then-immediately-close that causes the RST. (At
> least with some socket options).

That wouldn't be the case with my example program because neither the parent
nor the child actually write anything to the socket.  They just hold it
open and then close them in different orders to show the different results.


> For detail, see MSDN. Look up the closesocket() function, and read that
> page, and also "Graceful Shutdown, Linger Options, and Socket Closure"
> linked to from that page.

I didn't explicitly set any options, so I assume CygWin used the default
WinSock option of SO_DONTLINGER which means, as I read the page, that it
should delay the close until all data has been sent/ack'd and then disconnect
in the background.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/closesocket_2.asp

                                          Brian
                                 ( bcwhite AT precidia DOT com )

-------------------------------------------------------------------------------
"Everything that can be invented already has been."  --U.S. Patent Office, 1899

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019