close method

Future<void> close()

Stops serving (serve): the clients are disconnected, the socket closed and the address file removed if it still holds this sink's address; one still starting is closed once it has. Does nothing when not serving.

Implementation

Future<void> close() async {
  final starting = _starting;
  _starting = null;
  _server = null;
  removeListener(_send);
  if (starting == null) {
    return;
  }
  final LogServer server;
  try {
    server = await starting;
  } on Object {
    return; // it never started: what failed is serve's
  }
  await server.close();
}