Add a setKeepAlive() function for TCP connections.