Example #1
0
 internal void fClient_HaveMessage(StompMessage obj)
 {
     if (obj.TypeStr == "MESSAGE")
     {
         StompReceiveChannel lChannel;
         StringPair          lID = (from a in obj.Headers
                                    where a.Key == "subscription"
                                    select a).FirstOrDefault <StringPair>();
         if ((lID != null) && this.fReceivers.TryGetValue(lID.Value, out lChannel))
         {
             lChannel.DataAvailable(obj.Data);
         }
     }
 }
Example #2
0
 private void GotData(IAsyncResult ar)
 {
     try
     {
         StompMessage lCommand = ar.AsyncState as StompMessage;
         if (this.fSocket.EndRead(ar) == lCommand.Data.Length)
         {
             this.fSocket.BeginRead(this.fByteReader, 0, 1, new AsyncCallback(this.GotZeroByte), lCommand);
         }
     }
     catch
     {
     }
 }
Example #3
0
 private void GotZeroByte(IAsyncResult ar)
 {
     try
     {
         StompMessage lCommand = ar.AsyncState as StompMessage;
         if (!((this.fSocket.EndRead(ar) == 1) ? (this.fByteReader[0] != 0) : true))
         {
             if (this.HaveMessage != null)
             {
                 this.HaveMessage(lCommand);
             }
             this.fSocket.BeginReadLine(new AsyncCallback(this.GotCommand), null);
         }
     }
     catch
     {
     }
 }
Example #4
0
 private void GotCommand(IAsyncResult ar)
 {
     try
     {
         string res = this.fSocket.EndReadLine(ar);
         if (res != null)
         {
             StompMessage lCommand = new StompMessage
             {
                 TypeStr = res,
                 Headers = new List <StringPair>()
             };
             this.fSocket.BeginReadLine(new AsyncCallback(this.GotHeader), lCommand);
         }
     }
     catch
     {
     }
 }
Example #5
0
 private void GotCommand(IAsyncResult ar)
 {
     try
     {
         string res = this.fSocket.EndReadLine(ar);
         if (res != null)
         {
             StompMessage lCommand = new StompMessage
             {
                 TypeStr = res,
                 Headers = new List<StringPair>()
             };
             this.fSocket.BeginReadLine(new AsyncCallback(this.GotHeader), lCommand);
         }
     }
     catch
     {
     }
 }
Example #6
0
 internal void fClient_HaveMessage(StompMessage obj)
 {
     if (obj.TypeStr == "MESSAGE")
     {
         StompReceiveChannel lChannel;
         StringPair lID = (from a in obj.Headers
                                             where a.Key == "subscription"
                                             select a).FirstOrDefault<StringPair>();
         if ((lID != null) && this.fReceivers.TryGetValue(lID.Value, out lChannel))
         {
             lChannel.DataAvailable(obj.Data);
         }
     }
 }