public void Stop() { _cancellationTokenSource?.Cancel(); _cancellationTokenSource = null; _adapter.ClientConnected -= OnClientConnected; _adapter.Stop(); _clientSessionsManager.Clear(); MqttTrace.Information(nameof(MqttServer), "Stopped."); }
public void Stop() { _cancellationTokenSource?.Cancel(false); _cancellationTokenSource?.Dispose(); _cancellationTokenSource = null; foreach (var adapter in _adapters) { adapter.ClientConnected -= OnClientConnected; adapter.Stop(); } _clientSessionsManager.Clear(); MqttTrace.Information(nameof(MqttServer), "Stopped."); }
public async Task StopAsync() { _cancellationTokenSource?.Cancel(false); _cancellationTokenSource?.Dispose(); _cancellationTokenSource = null; foreach (var adapter in _adapters) { adapter.ClientAccepted -= OnClientAccepted; await adapter.StopAsync(); } _clientSessionsManager.Clear(); _logger.LogInformation("Stopped."); }
public async Task StopAsync() { _cancellationTokenSource?.Cancel(false); _cancellationTokenSource?.Dispose(); _cancellationTokenSource = null; foreach (var adapter in _adapters) { adapter.ClientAccepted -= OnClientAccepted; await adapter.StopAsync(); } _clientSessionsManager.Clear(); MqttNetTrace.Information(nameof(MqttServer), "Stopped."); }