Added HeartbeatTask to verify that both connection and session to a server are kept alive.