示例#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();
 }
示例#2
0
 public StompMessageEventArgs(StompMessage message)
 {
     Message = message;
 }
示例#3
0
 public StompMessageEventArgs(StompMessage message)
 {
     Message = message;
 }