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); } } }
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 { } }
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 { } }
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 { } }
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 { } }
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); } } }