connect static method

Future<Anonchat> connect({
  1. required String host,
  2. required int port,
})

Create a new TCP connection and construct class

Implementation

static Future<Anonchat> connect({
  required String host,
  required int port,
}) async {
  final socket = await Socket.connect(host, port);
  return Anonchat.fromSocket(socket);
}