Ejemplo n.º 1
0
        protected override void ChannelRead0(IChannelHandlerContext ctx, CmppMessageReceiveArgs <CmppHead, CmppDeliver> msg)
        {
            baseSmsHandler.CmppDeliver(msg);
            var resp = GetConnectRequestPacket(msg.Message.MsgId, msg.Header.SequenceId);

            CmppTools.SendAsync(ctx, resp);
        }
Ejemplo n.º 2
0
        protected override void ChannelRead0(IChannelHandlerContext ctx, CmppMessageReceiveArgs <CmppHead, CmppActiveTest> msg)
        {
            logger.Info($"receive active request: {msg}", ctx.Channel.ToString());
            SmsPacket activeResp = GetActiveRespPacket(msg.Header);

            CmppTools.SendAsync(ctx, activeResp);
        }
Ejemplo n.º 3
0
        private void SendActiveTest(IChannelHandlerContext context)
        {
            IMessage message = new CmppActiveTest();

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

            CmppTools.SendAsync(context, connect);
        }
Ejemplo n.º 4
0
        public override void ChannelActive(IChannelHandlerContext context)
        {
            logger.Info($"start login user:{config.UserName}, pwd:{config.Password}");
            this.context = context;
            SmsPacket connect = GetConnectRequestPacket(config.UserName, config.Password);

            CmppTools.SendAsync(context, connect);
            var delay = new TimeSpan(0, 0, disconnectSecond);

            timer.NewTimeout(this, delay);
            base.ChannelActive(context);
        }