示例#1
0
        /// <summary>
        /// Send message MSG_NEGO_REQ
        /// </summary>
        public void SendMsgNegoReq()
        {
            PccrrNegoRequestPacket packet = this.pccrrStack.CreateMsgNegoRequest(this.minSupV, this.maxSupV, this.cryptoAlgo, MsgType_Values.MSG_NEGO_REQ, this.protoVer);

            this.pccrrStack.SendPacket(packet, new TimeSpan(0, 0, this.timeout));

            PccrrPacket respMSG = this.pccrrStack.ExpectPacket();

            PccrrNegoResponsePacket pccrrNegoResponsePacket = respMSG as PccrrNegoResponsePacket;

            MSG_NEGO_RESP             msgNegoResp    = pccrrNegoResponsePacket.MsgNegoResp;
            MESSAGE_HEADER            messageHeader  = pccrrNegoResponsePacket.MessageHeader;
            TRANSPORT_RESPONSE_HEADER transportRespH = pccrrNegoResponsePacket.TransportResponseHeader;
            RESPONSE_MESSAGE          respMessage    = new RESPONSE_MESSAGE();

            respMessage.MESSAGEBODY             = msgNegoResp;
            respMessage.MESSAGEHEADER           = messageHeader;
            respMessage.TRANSPORTRESPONSEHEADER = transportRespH;
            this.uiPayload = Marshal.SizeOf(messageHeader) + Marshal.SizeOf(msgNegoResp);

            this.VerifyHttpResponse();
            PccrrBothRoleCaptureCode.CaptureHttpRequirements();
            this.VerifyMsgNegoResp(msgNegoResp);
            this.VerifyMessageHeader(messageHeader);
            PccrrBothRoleCaptureCode.CaptureMessageHeaderRequirements(messageHeader, this.uiPayload);
            this.VerifyTransportResponseHeader(transportRespH);
            PccrrBothRoleCaptureCode.CaptureMessageRequirements();
            this.VerifyResponseMessage(respMessage);

            this.ReceiveMsgNegoResp();
        }
        protected virtual void HandlePccrrNegoRequestPacket(PccrrNegoRequestPacket pccrrNegoRequest)
        {
            var pccrrNegoResponse = pccrrServer.CreateMsgNegoResponse(
                protoVersion,
                protoVersion,
                cryptoAlgoId,
                MsgType_Values.MSG_NEGO_RESP);

            pccrrServer.SendPacket(pccrrNegoResponse);
        }