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:
- The code uses DHCP to get assigned IP address, etc.
- The code has a separate thread running to handle TCP connections
- During initialization, the task calls fdOpenSession()
- During initialization, the task calls NDK_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
- During initialization, the task calls NDK_setsockopt to:
- Set SO_BLOCKING to 0 (non-blocking socket)
- Set SO_KEEPALIVE to 60
- Set SO_RCVTIMEO to 30000 microseconds
- Set SO_SNDTIMEO to 1 second
- Set SO_LINGER with linger_opt.l_linger = 1 and linger_opt.l_onoff = 0
- During initialization, the task calls NDK_bind() with AF_INET, IP address from DHCP and port number 9970
- During initialization, the task finally calls NDK_listen() with maxcon set to 8 (we will only handle 8 connections)
- 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!