closeByPeer method

Future<void> closeByPeer()

Closes the socket from the far end, without an error.

Leaves the transport closed, so a frame sent afterwards throws the way a real hung-up socket would.

Implementation

Future<void> closeByPeer() async {
  if (_incoming.isClosed) return;
  _closed = true;
  unawaited(_incoming.close());
}