SendBytes() public method

Send bytes.
public SendBytes ( byte bytes, System.TimeSpan timeout ) : void
bytes byte The bytes need to be sent.
timeout System.TimeSpan The timeout.
return void
        public void HostedCacheServer_PccrrServer_GetSegList_SegmentIDCountNotMatch()
        {
            CheckApplicability();

            var contentInformation = contentInformationUtility.CreateContentInformationV2();

            BaseTestSite.Log.Add(
                LogEntryKind.Debug,
                "Send malformed GetSegList request to hosted cache server");

            PccrrClient pccrrClient = new PccrrClient(
                testConfig.HostedCacheServerComputerName,
                testConfig.HostedCacheServerHTTPListenPort);

            var pccrrGetSegListRequest = pccrrClient.CreateMsgGetSegListRequest(
                CryptoAlgoId_Values.AES_128,
                Guid.NewGuid(),
                new byte[][] { contentInformation.GetSegmentId(0, 0) });
            var buffer = pccrrGetSegListRequest.Encode();
            buffer[35] = 2;
            pccrrClient.SendBytes(
                buffer,
                testConfig.Timeout);

            bool passed = false;
            try
            {
                pccrrClient.ExpectPacket();
            }
            catch
            {
                passed = true;
            }

            BaseTestSite.Assert.IsTrue(passed, "Hosted cache server should drop GetSegList packets with invalid segment ID count");
        }