Programmable KeepAlive-like structure for connections between TCP client/server