in reply to Re^2: Howto check if TCP connection is alive ?
in thread Howto check if TCP connection is alive ?

No, the server either needs to send you something periodically by design (a heatbeat), or you need to provoke it into sending something (by sending some request, even one for which you don't care about the answer).

As an example of the latter, my FTP client sends "TYPE I", "PWD" and other useless commands from time to time. None of the following accomplishes anything except to let the server know we are still alive, and conversely, letting us know the server is still alive.

COMMAND:> TYPE I 200 Type set to I COMMAND:> PWD 257 "/" is current directory. COMMAND:> TYPE A 200 Type set to A COMMAND:> PASV 227 Entering Passive Mode (69,163,167,32,177,6). COMMAND:> LIST STATUS:> Connecting ftp data socket 69.163.167.32:45318... 150 Opening ASCII mode data connection for file list 226 Transfer complete. COMMAND:> TYPE A 200 Type set to A COMMAND:> PWD 257 "/" is current directory. COMMAND:> REST 0 350 Restarting at 0. Send STORE or RETRIEVE to initiate transf +er COMMAND:> TYPE A 200 Type set to A COMMAND:> TYPE I 200 Type set to I