Problem:
EventType clr20r3, P1 kimofflinetoonline.exe, P2 0.6.0.1012, P3 464b389a, P4 kimofflinetoonline, P5 0.6.0.1012, P6 464b389a, P7 10, P8 1ab, P9 system.io.ioexception, P10 NIL.
Solution:
1. Enlarge socket timeout size both on receiving and sending side (if that do not solve problem, then use 2.)
2. This one is tricky :)
You are probably using some kind of TCP socket server, and client, and you are trying to spawn threads (with new TCP socket) at client side that access server , as fast as possible.
And after 4000-5000 spawned threads.... you get this error.
Why? Well Windows have default limitation on user created TCP sockets to around 5000.
To solve the problem, you have to add new key into registry.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort (as DWORD value) and to set it to value lesser then 65535 (max tcp port count).
I set it to 65534 and did not had any problems with it. This solution is working fine on real time C# server on win2003.
If this helps, great.... when you solve something like this.... post in blog, so we all can spare less time on searching for solutions, and more on coding.
keywords:
TCP/IP, how to avoid socket number limitation, .NET socket error , problems with sockets , TcpClient timeout
Thursday, June 7, 2007
Subscribe to:
Post Comments (Atom)
1 comment:
i am using win 2003 server and got the same error. great solution, it works fine, thank you very much!
Post a Comment