Example #1
0
 // Listening thread
 protected void Listener()
 {
     while (!quitReceiver)
     {
         try
         {
             StompMessage stompMessage = stompConnection.WaitForMessage();
             if (stompMessage == null)
             {
                 quitReceiver = true;
             }
             if (stompMessage != null)
             {
                 OnReceivedMessage(new StompMessageEventArgs(stompMessage));
             }
         }
         catch (ThreadInterruptedException)
         {
             Console.Error.WriteLine("WARNING: ThreadInterruptedException in Listener...");
             if (quitReceiver)
             {
                 break;
             }
         }
         catch (SocketException)
         {
             Console.Error.WriteLine("WARNING: SocketException in Listener...");
             if (quitReceiver)
             {
                 break;
             }
         }
     }
     stompConnection.Abort();
 }
Example #2
0
 public StompMessageEventArgs(StompMessage message)
 {
     Message = message;
 }
Example #3
0
 public StompMessageEventArgs(StompMessage message)
 {
     Message = message;
 }