In using Mina, I used the XP system to test how many long connections Mina actually supports. But the odd thing is to support up to 415 at a time.
This is completely inconsistent with the performance of Mina on the web. After research, it should be the reason for the operating system. Two registry connections can be modified to more than 4,000.
Here's how to modify it:
increase the number of Windows maximum TCP connection random ports
System default TCP Random port range is: 1024-5000
Two Windows registry keys that are closely related to this error: Values for TcpTimedWaitDelay and MaxUserPort.
TcpTimedWaitDelay determines the time that TCP/IP must elapse before it can release a closed connection and reuse its resources. This interval between shutdown and release is generally known as the time_wait state or twice times the maximum segment life cycle (2MSL) state. During this time, the cost of reopening the connection to the client and server is less than establishing a new connection. Reducing this value allows TCP/IP to release closed connections more quickly and to provide additional resources for new connections.
MaxUserPort determines the maximum number of ports to be used when requesting any available user ports from the system, and the highest port number that TCP/IP can specify. If you establish a TCP connection with a maximum port connection greater than 5000, the local computer responds to the following error message Wsaenobufs (10055): Because the system lacks enough buffers or because the queue is full and cannot perform operations on the socket, the application's 10048 errors are caused.
Open Registry Editor regedit
TcpTimedWaitDelay settings:
Locate the Hkey_local_machine\system\currentcontrolset\ Services\Tcpip\Parameters registry subkey
and create a new REG_DWORD value named TcpTimedWaitDelay
Set this value to decimal 30, hexadecimal to 0x0000001e
The wait time for this value will be 30 seconds.
Default value for this entry: 0xF0 (16), wait time set to 240 seconds
MaxUserPort settings (Increase maximum port connection):
Locate the Hkey_local_machine\system\currentcontrolset\ Services\Tcpip\Parameters registry subkey
and create a new REG_DWORD value named MaxUserPort
Set this value to decimal minimum 32768
The wait time for this value will be 30 seconds.
Reboot the Windows system.
Default value for this entry: 5000 (decimal)
Close the Registry Editor and restart the Windows system.
The
is essentially an operating system that restricts the number of TCP connections, and Mina's connections are the underlying TCP protocol traffic. Share it and learn from everyone.