// Listening thread protected void Listener() { while (!quitReceiver) { try { StompMessage stompMessage = stompConnection.WaitForMessage(); 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(); }
public StompMessageEventArgs(StompMessage message) { Message = message; }