Re: My server sometimes goes deaf to certain hosts




Jo wrote:

Ok, so you are saying that the listening process might be blocking
on one of the other sockets, thereby delaying the call to accept(). So
why does the client get connection refused, when the number of hosts
attempting to connect (1 or 2) does not exceed the backlog on the
listening socket?

The client should not ever get connection refused unless the number of
half-open connections exceeds the allowed backlog (which may not have
anything to do with the number you passed in 'listen') or the server
closed the listening port. If you get 'connection refused', either:

1) You didn't specify as large a backlog as you think you did.

2) The system didn't honor your backlog for some reason.

3) The server accidentally closed the listening port.

4) Something strange is going on with the path between the server and
the client, like a firewall or NAT application that thinks it
understands your protocol but really doesn't.

Maybe your server accidentally closed the socket it was listening on?

DS

.



Relevant Pages

  • Re: How to do Async TCP Listener?
    ... I suspect your listening socket is a "blocking" socket ... If so, your client ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sockets / erste Schritte
    ... > Client analog zu einem CodeGuru Beispiel geschrieben. ... Die Listener Applikation erstellt einen listening CSocket. ... Anschließend wird die ReceiveMethode des listening Sockts ... > jeweils zwei Sockets eine ...
    (microsoft.public.de.vc)
  • Re: Listen() Winsock query...
    ... listening socket and working socket, which you can move between threads, do ... that is each thread is able to accept a new connection on ... resume listening for incoming connections. ... without changing the backlog. ...
    (microsoft.public.win32.programmer.networks)
  • Re: My server sometimes goes deaf to certain hosts
    ... why does the client get connection refused, ... What is the backlog you specified? ... writeto the socket would indicate a closed connection. ...
    (comp.os.linux.development.apps)
  • Re: "connect" returns before server "accept"s
    ... >immediately if the server has been set to "listen" but has not called ... There's no event visible at the client ... >If the client calls connect again on a new socket *before* the ... Fix the client to retry or keep the listening socket open... ...
    (comp.unix.programmer)