void OnStreamError(object sender, StreamErrorEventArgs e) { dispatcher.Invoke(() => { bool handled = false; if (e.Exception is IOException) { var socketEx = e.Exception.InnerException as SocketException; if (socketEx != null) { switch (socketEx.SocketErrorCode) { case SocketError.Interrupted: handled = true; break; case SocketError.ConnectionAborted: case SocketError.ConnectionReset: if (!connection.Reconnect()) { LogOut(); } handled = true; break; } } } if (!handled) { throw e.Exception; } }); }
/// <summary> /// Called when a stream error is raised on the NetLayerWindow /// connection. /// </summary> /// <param name="Fatal">Supplies true if the error is fatal, else false /// if the error may be continuable.</param> /// <param name="ErrorCode">Supplies the error code.</param> /// <returns>True on success, else false on failure.</returns> private bool OnStreamError(bool Fatal, UInt32 ErrorCode) { StreamErrorEventArgs EventArgs; EventArgs = new StreamErrorEventArgs(Fatal, ErrorCode); StreamErrorEvent(this, EventArgs); return(true); }
/// <summary> /// Event handler for Stream error. /// </summary> /// <param name="sender">the sender object.</param> /// <param name="e">Event arguments.</param> private void OnStreamError(object sender, StreamErrorEventArgs e) { if (e.Stream == this) { if (e.Exeption is ProtocolExeption) { this.Close(((ProtocolExeption)e.Exeption).StatusCode); } else { this.Close(StatusCode.InternalError); } } }
/// <summary> /// Event handler for Stream error. /// </summary> /// <param name="sender">the sender object.</param> /// <param name="e">Event arguments.</param> private void OnStreamError(object sender, StreamErrorEventArgs e) { if (e.Stream == this) { if (e.Exeption is ProtocolExeption) { this.Close(((ProtocolExeption)e.Exeption).StatusCode); } else { this.Close(StatusCode.InternalError); } } }
private void xmppClient_OnStreamError(object sender, StreamErrorEventArgs e) { Console.WriteLine("OnStreamError"); }
private void XmppClient_OnStreamError(object sender, StreamErrorEventArgs e) { Log.Info("OnStreamError " + e.ToString()); }
private void xmppClient_OnStreamError(object sender, StreamErrorEventArgs e) { DisplayEvent("OnStreamError"); }
/// <summary> /// Called when a stream error is raised on the NetLayerWindow /// connection. /// </summary> /// <param name="Fatal">Supplies true if the error is fatal, else false /// if the error may be continuable.</param> /// <param name="ErrorCode">Supplies the error code.</param> /// <returns>True on success, else false on failure.</returns> private bool OnStreamError(bool Fatal, UInt32 ErrorCode) { StreamErrorEventArgs EventArgs; EventArgs = new StreamErrorEventArgs(Fatal, ErrorCode); StreamErrorEvent(this, EventArgs); return true; }
private void xmppClient_OnStreamError(object sender, StreamErrorEventArgs e) { DisplayEvent("OnStreamError"); }