TCP connections limited?

We have developed a TCP based server on Digi connect ME. Our setup is the following:

  • NETOS 7.3

  • 7 threads for accepting incoming connections from different tcp ports.

  • 12 threads to handle client connections for each server port.

After digi connect ME boots up, the following situation occurs: Windows based tcp client connects to our custom protocol, sends data and immediately disconnects. This sequence is repeated on a loop. Everything works fine, but the 109. connection request is not received by the socket accept function. After this, connection requests are received correctly. The problem is always with the 109. after the connect ME bootup.

What could be the cause of this? What is the maximum amount of sockets allowed in NETOS7.3 for connect ME? Work arounds? fixes?

The maximum number of sockets is 128.

When you close a socket in NET+OS, you need to make sure to use the closesocket() function, otherwise the socket doesn’t close.

Also, there can be up to a 60 second delay to close the socket, so depending on what’s going on, that may cause a problem. You can shorten this delay by using the NAIpSetTcpMsl function.

Finally, you may be running out of network heap talking that quickly, you may want to try increasing your network heap in your projects appconf.h -> APP_NET_HEAP_SIZE.

  • Sockets are closed correctly with closesocket-function
  • NAIpSetTcpMsl won’t help because this situation occurs within 5s.
  • Increasing the heap size -> didn’t notice any difference.

We are still puzzled? Could this be a bug with connect ME (4MB) NETOS7.3?

As I explained in my original post it’s always the 108. connection request which is not received by the accept function (after bootup). I have made analysis with wireshark and it seems that the TCP connection handshaking actually is done and my test client sends first data packet. But still digi application (the socket accept) doesn’t receive the connection.