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 Message-ID: <3E6762CA.8EF5B6A8@ieee.org> Date: Thu, 06 Mar 2003 10:01:30 -0500 From: "Pierre A. Humblet" X-Accept-Language: en,pdf MIME-Version: 1.0 To: Jason Tishler CC: Cygwin-Developers Subject: Re: Winsock closesocket() problem References: <20030306144658 DOT GB2008 AT tishler DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Jason Tishler wrote: > > Pierre and I have been working (privately) to solve the exim problem > that I mentioned in the following post: > > http://cygwin.com/ml/cygwin-developers/2003-02/msg00125.html > > It appears that under certain conditions Winsock's closesocket() is not > happy closing a socket more than once. See the attached test case, > sc9.cc, which demonstrates the problem when run under LocalSystem: > > $ sc9 > close(fd2) failed with 108 > > Note that the problem follows the second close(). If I switch the order > of the close() calls, then dup()-ed socket closes without any errors. > Hence, I don't believe that this problem is directly related to dup(). and then closing the original socket fails. Correct? > I have worked around the problem with the attached patch to > fhandler_socket::close(). Is this a reasonable way to solve this > problem? Or, does anyone have any other suggestions? Jason, last time we talked you indicated that the socket was in fact not closed. Do you know think it is closed but Windows errs in reporting an error? Pierre