Microsoft.Protocols.TestTools.StackSdk.BranchCache.Pchc.EncodeMessage.EncodeResponseMessage C# (CSharp) Method

EncodeResponseMessage() public static method

Transform the RESPONSE_MESSAGE to a byte array
public static EncodeResponseMessage ( RESPONSE_MESSAGE responseMessage ) : byte[]
responseMessage RESPONSE_MESSAGE The RESPONSE_MESSAGE message
return byte[]
        public static byte[] EncodeResponseMessage(RESPONSE_MESSAGE responseMessage)
        {
            List<byte> list = new List<byte>();
            list.AddRange(GetBytesFromUint32(responseMessage.TransportHeader.Size, false));
            list.Add((byte)responseMessage.ResponseCode);
            return list.ToArray();
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Send Reponse Message to the client.
        /// </summary>
        /// <param name="responseMessage">The response message.</param>
        public void SendPackage(RESPONSE_MESSAGE responseMessage)
        {
            this.SendByte(EncodeMessage.EncodeResponseMessage(responseMessage));

            if (this.logger != null)
            {
                this.logger.AddDebug("Pchc response message is sent successfully.");
            }
        }