[Mono-list] SocketException: Too many open files (1020 sockets at once)
Oriol de San Pedro
osp at tinet.org
Tue Feb 9 14:56:41 EST 2010
Any mono application running on Linux (this doesn't happen on Mono Windows
or NET Framework) issues a "System.Net.Sockets.SocketException: Too many
open files" when handling more than 1020 sockets at once.
I filed a bug here:
I also included a small program to reproduce the problem (it fails on all
Linux systems I have tested, not on Windows).
I think this bug deserves to be fixed, as it is blocking the development of
Here is the output of my test case:
10 Socket connection initiated, 10 Socket accepted
20 Socket connection initiated, 20 Socket accepted
30 Socket connection initiated, 30 Socket accepted
490 Socket connection initiated, 490 Socket accepted
500 Socket connection initiated, 500 Socket accepted
510 Socket connection initiated, 510 Socket accepted
Unhandled Exception: System.Net.Sockets.SocketException: Too many open files
at System.Net.Sockets.Socket..ctor (AddressFamily family, SocketType type,
ProtocolType proto) [0x0005e] in
Of course, the same thing happens in a real application having more than
1020 concurrent users.
More information about the Mono-list