Example #1
0
 /// <summary>
 /// Callback method to handle errors.
 /// </summary>
 /// <param name="client">The client to receive messages from.</param>
 /// <param name="exception">The generated exception.</param>
 internal void ClientErrorHandler(AsyncSocketClient client,
                                  Exception exception)
 {
     //fire off an error handler
     if (OnError != null)
     {
         CommonErrorEventArgs e = new CommonErrorEventArgs(exception);
         OnError(this, e);
     }
 }
Example #2
0
 private void DispatchOnError(CommonErrorEventArgs e)
 {
     if (OnError != null)
     {
         try
         {
             OnError(this, e);
         }
         catch (Exception ex)
         {
             _Log.Error("Unhandled exception thrown OnError event handler.", ex);
         }
     }
 }
Example #3
0
 /// <summary>
 /// Callback method to handle received messages.  The AsyncSocketClient
 /// library calls this; don't call it yourself.
 /// </summary>
 /// <param name="client">The client to receive messages from.</param>
 internal void ClientMessageHandler(AsyncSocketClient client)
 {
     try
     {
         Queue responseQueue = new PduFactory().GetPduQueue(client.Buffer);
         ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessPduQueue), responseQueue);
     }
     catch (Exception exception)
     {
         if (OnError != null)
         {
             CommonErrorEventArgs e = new CommonErrorEventArgs(exception);
             OnError(this, e);
         }
     }
 }
Example #4
0
 void communicator_OnError(object source, CommonErrorEventArgs e)
 {
     //Ошибка работы комуникатора
     PerformanceCountersService.GetCounter(CONNECTION_COUNTER_NAME).Decrement();
 }