close method

  1. @override
Future close()
override

Close the connection to the server.

Implementation

@override
Future close() {
  if (_socket == null) return Future.value();
  final sock = _socket!;
  _socket = null;
  return sock.then((s) => Future.wait([s.drain(), s.close()]));
}