Error 128 Open Connection Limit Exceeded in LabVIEW

Updated Aug 23, 2023

Reported In

Software

  • LabVIEW

Operating System

  • Windows

Issue Details

  • I'm using TCP/IP in LabVIEW for communication between a server and multiple clients. After some time, I receive Error 128.
  • After several listeners were created, my VI returns:
Error 128
LabVIEW: (Hex 0x80) Open connection limit exceeded
.
 
Error 128.png

 

Solution

VIs and functions that use TCP/IP connections in LabVIEW and VI Server properties and methods can return this error code. The following troubleshooting steps can mitigate this error:
  • Make sure that all the connections are properly closed when no longer needed. When the connections remain open, and more connections are created the Windows socket buffer might get filled, causing this problem.
    • Multiple sockets can be created when one client creates multiple connections to a server, or when multiple clients create a connection to a server.
    • The connections in both the server side and in the client side need to be closed.
    • You can use the netstat command to check the active TCP connections in Windows to verify the status of the sockets.
  • If you read and/or write repeatedly with a loop, try inserting a wait function in the loop (of around 200 ms).
  • The Deep Security software can be configured to allow a maximum number of TCP connections to protected computers. When the number of connections exceeds the maximum, network traffic is dropped, and Max TCP Connections firewall events may occur. Reduce the number of opened connections.

Additional Information

If the client side does not close the TCP socket and the socket is just closed in the server side, the client-side socket can be placed in a CLOSE_WAIT state which is reserved by the OS until it is instructed to release the socket. Eventually the number of sockets in the CLOSE_WAIT state can hit the limit specified by Windows in its socket pool and would not allow any new sockets to be opened.