Re: Response of listening socket when queue of pending connections is full



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.
.



Relevant Pages

  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #3]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... kernel socket family. ... presentation side is left to the client. ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • RE: CAsyncSocket performing RST on Connect()
    ... I have a windows client that opens a tcp connection and sometimes ... the connection underneath sends a RST just like in your trace. ...
    (microsoft.public.win32.programmer.networks)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • [PATCH 0/5] [RFC] AF_RXRPC socket family implementation [try #2]
    ... These patches together supply secure client-side RxRPC connectivity as a Linux ... Make it possible for the client socket to be used to go to more than one ... Each connection goes to a particular "service". ...
    (Linux-Kernel)
  • Re: Remote Client Configuration
    ... the client computer to the SBS domain via connect computer wizard remotely. ... local network or via dial up VPN connection, you will use an local copy on ... connection is established, Group Policy is not applied during logon. ...
    (microsoft.public.windows.server.sbs)

Loading