Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance of this class by parsing the specified byte array
        /// </summary>
        /// <param name="bOptionBytes">The data to parse</param>
        public TCPOption(byte[] bOptionBytes)
        {
            this.iOptionKind = (TCPOptionKind)(bOptionBytes[0]);

            if (iOptionKind != TCPOptionKind.EndOfList && iOptionKind != TCPOptionKind.NoOperation)
            {
                int iOptionLength = (int)(bOptionBytes[1]);
                this.bOptionData = new byte[iOptionLength - 2];
                for (int iC1 = 2; iC1 < iOptionLength; iC1++)
                {
                    bOptionData[iC1 - 2] = bOptionBytes[iC1];
                }
            }
            else
            {
                this.bOptionData = new byte[0];
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new empty instance of this class
 /// </summary>
 public TCPOption()
 {
     iOptionKind = TCPOptionKind.NoOperation;
     bOptionData = new byte[0];
 }