Пример #1
0
        /// <summary>
        /// Creates a new instance of this class with the contents specified in the given byte array
        /// </summary>
        /// <param name="bOptionBytes">The byte array to parse</param>
        public TCPOptions(byte[] bOptionBytes)
        {
            lOptions = new List <TCPOption>();
            int       iOffset = 0;
            TCPOption oOption;

            while (iOffset < bOptionBytes.Length)
            {
                byte[] bSubBytes = new byte[bOptionBytes.Length - iOffset];
                for (int iC1 = iOffset; iC1 < bOptionBytes.Length; iC1++)
                {
                    bSubBytes[iC1 - iOffset] = bOptionBytes[iC1];
                }
                oOption  = new TCPOption(bSubBytes);
                iOffset += oOption.OptionLength;
                lOptions.Add(oOption);
            }
        }
Пример #2
0
 /// <summary>
 /// Removes a single TCP option
 /// </summary>
 /// <param name="oOption">The option to remove</param>
 public void RemoveOption(TCPOption oOption)
 {
     lOptions.Remove(oOption);
 }
Пример #3
0
 /// <summary>
 /// Adds a single TCP option
 /// </summary>
 /// <param name="oOption">The option to add</param>
 public void AddOption(TCPOption oOption)
 {
     lOptions.Add(oOption);
 }