connect method
Implementation
Future<void> connect() async {
_socket ??= await Socket.connect('localhost', 4566);
// 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();
});
}