startHealthCheck method

void startHealthCheck()

Implementation

void startHealthCheck() {
  Timer.periodic(Duration(seconds: 10), (timer) async {
    try {
      final socket = await Socket.connect(
        Config.ip,
        Config.port,
        timeout: Duration(seconds: 1),
      );
      socket.destroy();
      logD('Proxy server health check pass...');
    } catch (e) {
      print('Server seems down: $e');
      retry();
    }
  });
}