Exemplo n.º 1
0
        private async Task DoReceiveDeliver(SgipMessageDeliver request)
        {
            var response = new SgipMessageDeliverResponse()
            {
                SequenceId1 = request.SequenceId1,
                SequenceId2 = request.SequenceId2,
                SequenceId3 = request.SequenceId3,
                Result      = 0
            };

            await this.Send(response);
        }
Exemplo n.º 2
0
        private async Task DoReceiveDeliver(SmsServerSession session, SgipMessageDeliver deliver)
        {
            var response = new SgipMessageDeliverResponse()
            {
                SequenceId1 = deliver.SequenceId1,
                SequenceId2 = deliver.SequenceId2,
                SequenceId3 = deliver.SequenceId3
            };

            response.Result = 0;
            await session.SendAsync(response);
        }
Exemplo n.º 3
0
        public NetworkMessage CreateNetworkMessage(BinaryReader reader)
        {
            uint         byteCount = reader.NetworkReadUInt32();
            SgipCommands command   = (SgipCommands)reader.NetworkReadUInt32();
            SgipMessage  message   = null;

            uint sid3 = reader.NetworkReadUInt32();
            uint sid2 = reader.NetworkReadUInt32();
            uint sid1 = reader.NetworkReadUInt32();

            switch (command)
            {
            case SgipCommands.BindResponse:
                message = new SgipMessageBindResponse();
                break;

            case SgipCommands.Bind:
                message = new SgipMessageBind();
                break;

            case SgipCommands.Unbind:
                message = new SgipMessageUnbind();
                break;

            case SgipCommands.UnbindResponse:
                message = new SgipMessageUnbindResponse();
                break;

            case SgipCommands.Submit:
                message = new SgipMessageSubmit();
                break;

            case SgipCommands.SubmitResponse:
                message = new SgipMessageSubmitResponse();
                break;

            case SgipCommands.Deliver:     //receive sms
                message = new SgipMessageDeliver();
                break;

            case SgipCommands.DeliverResponse:
                message = new SgipMessageDeliverResponse();
                break;

            case SgipCommands.Report:
                message = new SgipMessageReport();
                break;

            case SgipCommands.ReportResponse:
                message = new SgipMessageReportResponse();
                break;

            case SgipCommands.None:
            default:
                message = new SgipMessage();
                break;
            }

            if (message != null)
            {
                message.Command     = command;
                message.ByteCount   = byteCount;
                message.SequenceId1 = sid1;
                message.SequenceId2 = sid2;
                message.SequenceId3 = sid3;
                message.NetworkRead(reader);
            }

            return(message);
        }