Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.PCHCClient.SendInitialOfferMessage C# (CSharp) Method

SendInitialOfferMessage() public method

Send the INITIAL_OFFER_MESSAGE request.
public SendInitialOfferMessage ( INITIAL_OFFER_MESSAGE initialOfferMessage ) : RESPONSE_MESSAGE
initialOfferMessage INITIAL_OFFER_MESSAGE The INITIAL_OFFER_MESSAGE message.
return RESPONSE_MESSAGE
        public RESPONSE_MESSAGE SendInitialOfferMessage(INITIAL_OFFER_MESSAGE initialOfferMessage)
        {
            return this.responseMessage = this.SendByte(EncodeMessage.EncodeInitialOfferMessage(initialOfferMessage));
        }

Usage Example

        public void HostedCacheServer_PchcServer_MessageHeader_TypeInvalid()
        {
            CheckApplicability();

            PCHCClient pchcClient = new PCHCClient(
                    TransferProtocol.HTTPS,
                    testConfig.HostedCacheServerComputerName,
                    testConfig.HostedCacheServerHTTPSListenPort,
                    PchcConsts.HttpsUrl,
                    testConfig.DomainName,
                    testConfig.UserName,
                    testConfig.UserPassword);

            BaseTestSite.Log.Add(
                LogEntryKind.Debug,
                "Send message with invalid message type to hosted cache server");

            var initialOffer = pchcClient.CreateInitialOfferMessage(
                testConfig.ClientContentRetrievalListenPort,
                new byte[0]);

            initialOffer.MsgHeader.MsgType = (PCHC_MESSAGE_TYPE)0xFEFE;

            bool passed = false;
            try
            {
                pchcClient.SendInitialOfferMessage(initialOffer);
            }
            catch
            {
                passed = true;
            }

            BaseTestSite.Assert.IsTrue(passed, "Hosted cache server should drop message with invalid message type");
        }
All Usage Examples Of Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.PCHCClient::SendInitialOfferMessage