This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: Winsock closesocket() problem
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: Jason Tishler <jason at tishler dot net>
- Cc: Cygwin-Developers <cygwin-developers at cygwin dot com>
- Date: Thu, 06 Mar 2003 10:01:30 -0500
- Subject: Re: Winsock closesocket() problem
- References: <20030306144658.GB2008@tishler.net>
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