connect method

Future<void> connect()

Implementation

Future<void> connect() async {
  _socket ??= await Socket.connect('localhost', 4567);

  // Note: State is updated only by timed interval.
  // This is to prevent sending too many updates.
  _timer ??= Timer.periodic(const Duration(seconds: 5), (timer) {
    _sendState();
  });
}