예제 #1
0
        /// <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());
            }
        }
예제 #2
0
        /// <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());
            }
        }
예제 #3
0
 public void Decoder(byte[] bytes)
 {
     PBUtils.Buffer2Packet(this, bytes);
 }
예제 #4
0
 public byte[] Encoder()
 {
     return(PBUtils.Packet2Buffer(this));
 }