Пример #1
0
        protected override bool UnPacket(byte[] recv_all)
        {
            RecvPackage = Encoding.UTF8.GetString(recv_all);
            Log.Info("recv packet : " + RecvPackage);

            try
            {
                if (string.IsNullOrEmpty(RecvPackage))
                {
                    return(false);
                }
                RecvPacketData packetData = new RecvPacketData();
                packetData = JsonConvert.DeserializeObject <RecvPacketData>(RecvPackage);
                respcode   = packetData.respcode;
                respmsg    = packetData.respmsg;
                if (respcode == "00")
                {
                    CNoticeTrans cNotice = new CNoticeTrans(_entity);
                    return(cNotice.getUnpacket(packetData.postdata));
                    //RecvPostdata postdata = new RecvPostdata();
                    //postdata = JsonConvert.DeserializeObject<RecvPostdata>(packetData.postdata);
                    //RETURNCODE = postdata.ADDITIONDATA.RETURNCODE;
                    //MESSAGE = postdata.ADDITIONDATA.MESSAGE;
                    //if (postdata.ADDITIONDATA.RETURNCODE == "00")

                    //return true;

                    //else
                    //    return false;
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                Log.Error("[" + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "][" + System.Reflection.MethodBase.GetCurrentMethod().Name + "] err" + ex);
                return(false);
            }
        }
Пример #2
0
        private string getNoticePacket()
        {
            CNoticeTrans cNotice = new CNoticeTrans(_entity);

            return(cNotice.GetPacket());
        }