XBee WiFi - client comms socket timeout period

I have the XBee S6B setup to act as a tcp client in API mode. It connects to a server on a port specified in the frame and sends its data just fine.
The remote server sends a response back down the same socket the data was received on and this also works fine when there is an immediate response. However is the response is delayed because it has to retrieve some info over a slow 3G link then the response is never received by the Xbee. The delay is around 500-1000ms.
I guess the firmware is closing the socket at some point but how do I get around this? I have changed TM but it does not appear to make any difference. I also have the option in the API frame to close socket after sending turned off - so I guess it should be using TM but does not seem to.
Any help would be much appreciated.

I’m having the same problem man, did you found a solution?

Best Regards

Page 89 of the manual indicates the following:

Bit field: BIT 1 =
1 - Terminate socket after tx complete
0 - Leave socket open (use TCP timeout).
Ignore bit for UDP packets. All other bits are reserved and
should be 0.

So I would suggest looking at your TCP timeout value and adjusting it.

TM is the timeout setting.

TM is Client initiated connection time out.