/// <summary> /// 发送消息 /// </summary> /// <param name="msg"></param> public override void SendMessage(PBBody pbbody) { PBPacket packet = PBUtils.NewPacket(pbbody); try { mSendQueue.Enqueue(packet); } catch (Exception ex) { new Exception(ex.ToString()); } }
/// <summary> /// 发送Http消息 /// </summary> /// <param name="msg"></param> /// <param name="key"></param> public override void SendMessage(PBBody msg, string key = null) { PBPacket packet = PBUtils.NewPacket(msg); if (string.IsNullOrEmpty(key)) { return; } mReqUrl = mURL + key; try { mSendQueue.Enqueue(packet); } catch (Exception ex) { throw new Exception(ex.ToString()); } }
public void Decoder(byte[] bytes) { PBUtils.Buffer2Packet(this, bytes); }
public byte[] Encoder() { return(PBUtils.Packet2Buffer(this)); }