epoll problem and socket limits?

From: Billy Joe (billyjoe_at_toothdr.com)
Date: 09/15/04


Date: Wed, 15 Sep 2004 14:17:43 -0400

I'm having a problem with socket programming on Linux. I have many clients
connecting to a listen()ing socket. If I exceed the number of allowable
sockets for my process, accept() will still return a valid socket number.
The problem is that the entire process then stops receiving socket events.
The second a client disconnects and brings the server's socket count below
its maximum, the events start happening again.

The problem is that just exceeding the socket count hasn't been a reliable
indication for me - that is, I can't just hard-code this limit. First, it
may not be the same on every platform the application will run on. Second,
if a socket (a TCP client) is in any of the termination _WAIT states after
it has terminated, I'll be given the socket back but it still seems to
hang the server process. If I wait for them to expire it goes back to
normal.

What's going on, and is there some way I can identify either:
1) That I've hit the limit, so I can stop calling accept(), or
2) That I've EXCEEDED the limit and am now not getting events?

What I'd REALLY like to do is have the accept() call fail but that's not
happening. Also, why does socket 1027 affect socket 43? Shouldn't socket
43 continue operating normally, even if socket 1027 is past my limit?

Thanks,
Bill



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)
  • [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: How do I tell an object to free up an owned object from thta object itself?
    ... I tested running a sequence of connect/disconnect from the client ... client address for those connections that were active. ... In the ClientConnect event I create a handler object for processing ... >Socket is in fact a TServerClientWinSocket which acts as a end-connection ...
    (comp.lang.pascal.delphi.misc)
  • Re: question about class Socket
    ... run the following code, the client send a test string, but it doesn't ... // State object for receiving data from remote device. ... // Client socket. ...
    (microsoft.public.dotnet.framework)