TCPClient Timeout?

Hi guys,

Is there some default timeout value set on the TCPClient after connection is estaqbilished?

I’ve a code that sends some data to the remote server at a random time intervals. Sometimes TCPClient could be seating without receiving or sending any data for more than a minute. after such a long wait on my server I can see that the connection form core is stuck in the CLOSE_WAIT state, although client.connected() returns true.
If that happens I’m forced to restart Core in order to reconnect to the server.
Now I’ve noticed that if core is sending data over the socket more frequently that problem is gone.

Hi @kubac65,

The Core actively pings the cloud server through its main socket every 15 seconds, if very long blocking or delay operations interrupt that, it can cause the Core to think it has lost its connection to the server, and try to restart.

I believe the CC3000 has a separate idle socket timeout at around 60 seconds, so any socket you open needs to be kept alive at that interval to stay up. I’m guessing you’re probably running into that limit.



I’ve changed the code to send keep alive packet every 20 seconds. It seems to have solved the problem.


1 Like