/// <summary> /// Handles the disconnect. /// </summary> /// <param name="socketError">The socket error.</param> /// <param name="exception">The exception.</param> private void HandleDisconnect(SocketError socketError, Exception exception) { try { if (_socket != null && _socket.Connected) { try { _socket.Shutdown(SocketShutdown.Both); _socket.Close(); } catch (Exception) { // ignored } } _connected = false; Parser.Dispose(); SocketConnectionCheck.FreeConnection(GetIp()); DisconnectAction(this, exception); } catch (Exception ex) { YupiLogManager.LogException(ex, "Failed Receiving Connection Data."); } }
/// <summary> /// Handles the disconnect. /// </summary> /// <param name="socketError">The socket error.</param> /// <param name="exception">The exception.</param> private void HandleDisconnect(SocketError socketError, Exception exception) { try { if (_socket != null && _socket.Connected) { try { _socket.Shutdown(SocketShutdown.Both); _socket.Close(); } catch (Exception) { // ignored } } _connected = false; Parser.Dispose(); SocketConnectionCheck.FreeConnection(GetIp()); DisconnectAction(this, exception); } catch (Exception ex) { ServerLogManager.LogException(ex.ToString()); ServerLogManager.HandleException(ex, "Yupi.Connection.Connection.ConnectionInformation"); } }