/// <inheritdoc /> public override void Dispose() { if (Connected) { disconnecting = true; client.Disconnect(); //just closes the socket } }
/// <summary> /// Stop irc connection /// </summary> /// <returns>True if is ok</returns> public bool Stop() { var ret = false; try { if (_irc.IsConnected) { _irc.Disconnect(); } ret = true; } catch (Exception ex) { Logger.Error(ex); } return(ret); }
/// <inheritdoc /> public void Disconnect() { try { lock (IRCLock) { if (irc.IsConnected) { irc.RfcQuit("Twas meant to be..."); irc.Disconnect(); } } } catch { } }
/// <summary> /// Trennt die Verbindung zum Server /// </summary> public void Disconnect() { Connected = false; if (_connection != null) { if (_connection.IsConnected) { try { _connection.RfcQuit(Settings.QuitMessage); _connection.Disconnect(); } catch (NotConnectedException) { } Log.Information("Verbindung zu Server {ServerAddress} getrennt", Settings.Address); } _connection = null; } }