This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C129ENCZAD: TI NDK only allowing 6 connections to my device

Part Number: TM4C129ENCZAD

Hi,

I am seeing a weird issue where the TI NDK running on my TIVA processor is only allowing 6 TCP connections to my device.  Once 6 TCP connections are established to the device other connections WILL NOT be established, and NDK_accept() always returns EWOULDBLOCK when called.

I can't post my code but I will summarize it here:

  1. The code uses DHCP to get assigned IP address, etc.
  2. The code has a separate thread running to handle TCP connections
  3. During initialization, the task calls fdOpenSession()
  4. During initialization, the task calls NDK_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
  5. During initialization, the task calls NDK_setsockopt to:
    1. Set SO_BLOCKING to 0 (non-blocking socket)
    2. Set SO_KEEPALIVE to 60
    3. Set SO_RCVTIMEO to 30000 microseconds
    4. Set SO_SNDTIMEO to 1 second
    5. Set SO_LINGER with linger_opt.l_linger = 1 and linger_opt.l_onoff = 0
  6. During initialization, the task calls NDK_bind() with AF_INET, IP address from DHCP and port number 9970
  7. During initialization, the task finally calls NDK_listen() with maxcon set to 8 (we will only handle 8 connections)
  8. In a loop, the task calls NDK_accept() to look for new connections

There is error checking done through the entire initialization process and for the first 6 connections everything works fine, and NDK_accept() returns valid socket handles.  But after 6 connections have been established, NDK_accept() always returns EWOULDBLOCK error.  Has anyone seen anything like this or does anyone have any suggestions as to how to allow all 8 connections? 

Thanks!