Added heartbeat ping to the procotol to detect connection loss