connect method
Implementation
Future<PosPrintResult> connect(String host,
{int port = 91000, Duration timeout = const Duration(seconds: 5)}) async {
_host = host;
_port = port;
try {
_socket = await Socket.connect(host, port, timeout: timeout);
_socket.add(_generator.reset());
return Future<PosPrintResult>.value(PosPrintResult.success);
} catch (e) {
return Future<PosPrintResult>.value(PosPrintResult.timeout);
}
}