コード例 #1
0
        private void SendActiveTest(IChannelHandlerContext context)
        {
            IMessage message = new CmppActiveTest();

            CmppTools.GroupPacket(message);
            SmsPacket connect = CmppTools.GroupPacket(message);

            CmppTools.SendAsync(context, connect);
        }
コード例 #2
0
        private SmsPacket GetConnectRequestPacket(ulong msgId, uint seq)
        {
            var      date    = DateTime.Now;
            IMessage message = new CmppDeliverResp()
            {
                MsgId  = msgId,
                Result = 0
            };

            return(CmppTools.GroupPacket(message, seq));
        }
コード例 #3
0
        private SmsPacket GetConnectRequestPacket(string userName, string password)
        {
            var date = DateTime.Now;

            authenticatorSource = CmppTools.CreateAuthenticatorSource(date, userName, password);
            IMessage message = new CmppConnect()
            {
                TimeStamp           = uint.Parse(string.Format("{0:MMddHHmmss}", date)),
                AuthenticatorSource = authenticatorSource,
                Version             = CmppConstants.Version,
                SourceAddress       = userName,
            };

            return(CmppTools.GroupPacket(message));
        }
コード例 #4
0
        private SmsPacket GetActiveRespPacket(CmppHead head)
        {
            IMessage message = new CmppActiveTestResp();

            return(CmppTools.GroupPacket(message, head.SequenceId));
        }