Can I change the sending and receiving timeout after establishing a TCP connection?

The official TCP/UDP routines are set to send and receive timeout times during socket initialization; So, can we still change the sending and receiving timeout at any time through FreeRTOS_setsockopt (socket, 0, FREeRTOSSSO-RCVTIMEO,&xTicksToWait, sizeof (xTicksToWait)) and FreeRTOS_setsockopt (socket, 0, FREeRTOSSSO-SNDTIMEO,&xTicksToWait, sizeof (xTicksToWait)) after the TCP connection is established

Hi @hane_vv,
Yes, the stack does support modifying the send/receive timeout multiple times. However, please be aware that there could potentially be some timing discrepancies, where the currently running timeout may not be updated simultaneously. This behavior would only affect the send/receive operations occurring after the timeout has been reconfigured.

Thank you.


Yes, it’s possible to adjust the sending and receiving timeouts after establishing a TCP connection. In most programming languages, you can dynamically set socket options to modify these timeouts. For example, in Python using the socket module, you can set the sending and receiving timeouts using setsockopt method. Similar methods or options exist in other languages for adjusting timeouts as needed.