public async Task DisconnectAsync() { _isDisconnecting = true; if (_connection != null && _connection.IsConnected) { await _connection.Close(); } }
private async Task Disconnect() { _isDisconnecting = true; if (_slackConnection != null && _slackConnection.IsConnected) { await _slackConnection.Close(); } }
public void Disconnect() { _isDisconnecting = true; if (_connection != null && _connection.IsConnected) { _connection .Close() .GetAwaiter() .GetResult(); } }
private void Disconnected() { Log.Information("Disconnected"); RemoveEvents(); try { _connection.Close().Wait(); } catch (Exception e) { Log.Warning("SlackService Ensure disconnected: " + e.Message); } Log.Information("Trying to reconnect."); Connect().ContinueWith(x => { if (x.Exception != null) { Log.Error(x.Exception.Message, x.Exception); } }); }
public virtual void Dispose() { Task.Run(() => SlackConnection.Close()) .GetAwaiter() .GetResult(); }
public async Task Close() { await connection.Close(); }
public override async Task StopAsync() { await Connection.Close(); await base.StopAsync(); }
public async Task Disconnect() { _connection.OnDisconnect -= HandleDisconnect; await _connection.Close(); }
public async Task StopAsync(CancellationToken cancellationToken) { _connection.OnMessageReceived -= ConnectionOnOnMessageReceived; _connection.OnDisconnect -= ConnectionOnOnDisconnect; await _connection.Close(); }