Simpler heartbeart logic. Also use maxSockets 1 to keepAlive socket.