public virtual async Task StopHostingAsync() { IsListening = false; // stop being available to service discoverers await _servicePublisher.Unpublish(); // stop accepting new connections await _messageHub.StopListeningAsync(); // send a shutdown message // TODO: ... // disconnect everyone await _messageHub.DisconnectAllClients(); }