Exemplo n.º 1
0
 protected void OnConnectionClose(bool withError)
 {
     try
     {
         ConnectionClose?.Invoke(this, withError);
     }
     catch (Exception exc)
     {
         OnError(exc, true);
     }
 }
Exemplo n.º 2
0
 protected void OnConnectionClose(bool withError)
 {
     System.Threading.Tasks.Task.Run(() =>
     {
         ConnectionClose?.Invoke(this, withError);
     }).ContinueWith(task =>
     {
         if (task.IsFaulted)
         {
             OnError(task.Exception.InnerException, true);
         }
     });
 }
 /// <summary>
 /// Triggered when the connection is closed from any reason.
 /// </summary>
 /// <param name="sender">IMessageClient</param>
 /// <param name="e">null</param>
 private void OnConnectionClosed(object sender, EventArgs e)
 {
     ConnectionClose?.Invoke(this, e);
 }