stop method

void stop()
inherited

Stop the client and close any associated sockets.

Implementation

void stop() {
  if (!_started) {
    return;
  }
  if (_starting) {
    throw StateError('Cannot stop mDNS client while it is starting.');
  }

  _incomingIPv4?.close();
  _incomingIPv4 = null;

  for (final RawDatagramSocket socket in _ipv6InterfaceSockets) {
    socket.close();
  }
  _ipv6InterfaceSockets.clear();

  _resolver.clearPendingRequests();

  _started = false;
}