checkHeartbeats method

  1. @override
Future<void> checkHeartbeats()
inherited

Checks if a heartbeat has been received. If not, calls onDisconnect.

This function runs every heartbeatInterval seconds via heartbeatTimer.

Implementation

@override
Future<void> checkHeartbeats() async {
  if (didReceivedHeartbeat) {
    didReceivedHeartbeat = false;
  } else if (isConnected) {
    logger.warning("Heartbeat not received. Assuming the dashboard has disconnected");
    onDisconnect();
  }
}