Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Unable to perform operations on sockets due to insufficient system buffer space or queue full-solution

Shulou Source: shulou.com Published: 2022-06-03 02:09:46 11月12日 Update

Exception message:

System.Net.Sockets.SocketException (0x80004005): cannot perform an operation on a socket due to insufficient system buffer space or a full queue. 192.168.0.187:22

At System.Net.Sockets.Socket.DoConnect (EndPoint endPointSnapshot, SocketAddress socketAddress)

At System.Net.Sockets.Socket.Connect (EndPoint remoteEP)

At Tamir.SharpSsh.java.net.Socket..ctor (String host, Int32 port)

At Tamir.SharpSsh.jsch.Util.createSocket (String host, Int32 port, Int32 timeout)

Error description:

WebService and processing services are deployed on the server: WebService has client polling calls; processing services also poll the database

Upload the file to SFTP after relevant processing.

Solution:

Check that the operation on the socket cannot be performed due to insufficient system buffer space or queue full

Use NETSTAT-ano > C:\ NET.TXT

Found at the end of the file C:\ NET.TXT

TCP 192.168.1.122:65529 192.168.1.124:53343 FIN_WAIT_2 22668

TCP 192.168.1.122:65530 192.168.1.124:53017 FIN_WAIT_2 14508

TCP 192.168.1.122:65531 192.168.1.124:64365 FIN_WAIT_2 23160

TCP 192.168.1.122:65532 192.168.1.124:58246 FIN_WAIT_2 23064

Verify that the socket ports on the server have been allocated.

Modify two registries:

HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ Tcpip\ Parameters\ MaxUserPort if not, manually create DWord (32-bit) "numeric data" to decimal 65534 or as appropriate.

This value represents the maximum number of ports used by the user, and the default is 5000.

HKEY_LOCAL_MACHINE\ System\ CurrentControlSet\ Services\ Tcpip\ Parameters\ TCPTimedWaitDelay if not, manually create DWord (32-bit) "numeric data" to decimal 30 or whatever you think is appropriate.

This value indicates how long a closed port can wait before it can be reused. The default is 120 seconds, that is, 2 minutes before it can be reused.

Refer to the explanation of Microsoft parameters: https://technet.microsoft.com/en-us/library/cc938196.aspx

DOS cmd command "netstat-n" to view the TCP connection

Tags: Services sockets data ports processing space system buffer queue buffer appropriate decimal manual numeric file server decimal method maximum two Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Docker OPPO Reno Xiaomi MariaDB