private async Task DoReceiveReport(SgipMessageReport request) { this.RaiseReportReceived(request); var cids = this.SequenceId; var response = new SgipMessageReportResponse() { SequenceId3 = cids[0], SequenceId2 = cids[1], SequenceId1 = cids[2], Result = 0 }; await this.Send(response); }
private async Task DoReceiveReport(SmsServerSession session, SgipMessageReport report) { //sending response var response = new SgipMessageReportResponse() { SequenceId1 = report.SequenceId1, SequenceId2 = report.SequenceId2, SequenceId3 = report.SequenceId3 }; response.Result = 0; var t = session.SendAsync(response); this.RaiseReportReceived(report); await t; }
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); }