Re: Response of listening socket when queue of pending connections is full
- From: alun@xxxxxxxxxxxxx (Alun Jones)
- Date: Thu, 29 Dec 2005 06:02:32 GMT
In article <ldrvq15g5kltks41dmi60hj3e7iqm1i3p8@xxxxxxx>, Gary Edstrom
<gedstrom@xxxxxxxxxxx> wrote:
>In my application, if I don't respond to a client's connection request
>in a timely manner, the data that the client want's to send me will be
>lost forever. If I had had control over the client end of the software,
>I would have designed it to re-attempt the connection later, but I have
>no such control. So I need to make every effort to accept the
>connection the first time.
Sounds like the client author was expecting to always connect to a Unix
server. Unix (and pretty much every other TCP implementation) acts in the
right way when a connection comes in on a busy socket - it simply ignores the
SYN. This allows the TCP stack to do its usual "back off and retry" without
the client having to think about it.
On Windows, for some reason, the TCP stack responds with a RST, which is
supposed to mean "there's nobody listening here - go away".
Now, because of this, Microsoft had to add a similar kludge to the client side
of the TCP stack - it won't treat a RST as an invitation to go away, it treats
a RST as an invitation to back off and retry. After the requisite amount of
retries, the client will signal WSAETIMEDOUT as the error from connect - not
WSAECONNREFUSED.
Of course, a Unix client, or one on a TCP stack other than Windows, the first
RST will make the client's connect signal ECONNREFUSED.
>I have attempted to make sure that WSAECONNREFUSED never occurs on my
>end, but I would still like to be able to look at some statistics to see
>if it ever has.
There's no way I am aware of to prevent this RST from happening, except to
keep bugging the TCP guys in Microsoft to get them to do it like the rest of
the world.
Others have already answered you about the statistics, so I won't touch that
topic.
Alun.
~~~~
[Please don't email posters, if a Usenet response is appropriate.]
--
Texas Imperial Software | Find us at http://www.wftpd.com or email
23921 57th Ave SE | alun@xxxxxxxxxx
Washington WA 98072-8661 | WFTPD, WFTPD Pro are Windows FTP servers.
Fax/Voice +1(425)807-1787 | Try our NEW client software, WFTPD Explorer.
.
- Prev by Date: RE: Event 4226 issue - TCP half open connection limits.
- Next by Date: Re: How to make the setsockopt available
- Previous by thread: Re: Response of listening socket when queue of pending connections is full
- Next by thread: Re: CAsyncSocket::Connect Blocks
- Index(es):
Relevant Pages
|
Loading