Mail Archives: cygwin-developers/2002/07/29/17:48:30

Mailing-List: contact cygwin-developers-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT cygwin DOT com>
List-Archive: <>
List-Post: <mailto:cygwin-developers AT cygwin DOT com>
List-Help: <mailto:cygwin-developers-help AT cygwin DOT com>, <>
Sender: cygwin-developers-owner AT cygwin DOT com
Delivered-To: mailing list cygwin-developers AT cygwin DOT com
Message-ID: <>
Date: Mon, 29 Jul 2002 17:48:26 -0400
From: "Pierre A. Humblet" <Pierre DOT Humblet AT ieee DOT org>
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: Conrad Scott <Conrad DOT Scott AT dsl DOT pipex DOT com>
CC: cygwin-developers AT cygwin DOT com
Subject: Re: TCP problems
References: <010901c23724$96e5d430$6132bc3e AT BABEL> <3D4581E4 DOT BB580995 AT ieee DOT org> <005801c23730$02304170$6132bc3e AT BABEL> <3D459257 DOT 240C79DC AT ieee DOT org> <009c01c23736$4a61a4b0$6132bc3e AT BABEL> <3D459CEC DOT 35B29D99 AT ieee DOT org> <00f901c23747$168054f0$6132bc3e AT BABEL>

Conrad Scott wrote:

> It does seem to be something to do with TIME_WAIT and linger but
> I'm unclear exactly what.  Do any of the following sound familiar?
> *) The original problem (with a clean copy of CVS head, compiled
> either w/ or w/o debugging enabled) was that the server would
> accept a certain number of successive connections then refuse to
> accept any more until it was restarted.  Waiting a substantial
> amount of time didn't clear the problem up, only re-starting the
> server worked, so I don't see how it's a TIME_WAIT problem.

Or once it overflows some limits it gets into a screwed up state
and stays there.

> *) I just hacked the linger setting out of fhandler_socket::close
> and now the server seems to accept an unbounded number of
> successive connections.  I just tried 10000, which is more than
> twice the number of temporary ports, w/o any problem.

But I would bet that won't help Nicholas' ME. He will need to set
linger ON and timeout to 0 (or possibly some small positive). 
> I'll try some more combinations, but interestingly I can't
> recreate this with my direct winsock2 server: linger or not it
> runs forever too.  I'll try some more combinations.

Weird. Cygwin also makes direct Windows calls. There must be
a slight difference.

> Another strangeness I'm getting is that if I run netstat -a on my
> win98/SE box, it never shows more than 10 connections (e.g. one
> LISTENING and nine, the most recent nine port numbers, in
> TIME_WAIT).  This is regardless of the other changes I've
> described.  There must be more ports in TIME_WAIT than that
> (especially with the linger setting in cygwin) so what's up?  Is
> netstat known to be dodgy on win98?

Not that I know of.
Note that netstat is showing you connections, not sockets in use. 
They are different. E.g. with shutdown () the connections are gone 
but you can get WSAENOBUFS, indicating the sockets are still using


- Raw text -

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