stop method

void stop()

Implementation

void stop() {
  if (_discoverySearchTimer != null) {
    _discoverySearchTimer!.cancel();
    _discoverySearchTimer = null;
  }

  for (var socket in _sockets) {
    socket.close();
  }

  if (!_clientController.isClosed) {
    _clientController.close();
    _clientController = StreamController<DiscoveredClient>.broadcast();
  }
}