How many connections can accept a 'binded' socket?

billiejoex gnewsg at
Tue Mar 20 13:48:12 CET 2007

I'm writing a small asyncore-based server application serving a lot of
clients. When I have to handle more than 1021 client simoultaneously
the 'binded' socket object raises an error:

connections: 1018
connections: 1019
connections: 1020
connections: 1021
Traceback (most recent call last):
  File "", line 31, in <module>
  File "", line 191, in loop
  File "", line 138, in poll
  File "", line 80, in write
  File "", line 76, in write
  File "", line 395, in handle_write_event
  File "", line 24, in handle_connect
  File "", line 9, in __init__
  File "", line 257, in create_socket
  File "", line 156, in __init__
socket.error: (24, 'Too many open files')

I just wanna know: is there a way to know how many connections can
accept a 'binded' socket BEFORE getting such error? Maybe
socket.SOMAXCONN could help me?

Thanks in advance.

More information about the Python-list mailing list