示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UdpPacket"/> class, with
        /// no payload.
        /// 
        /// Header must be populated manually.
        /// </summary>
        /// <param name="type">The type.</param>
        public UdpPacket(EUdpPacketType type)
        {
            this.Header = new UdpHeader();
            this.Payload = new MemoryStream();

            this.Header.PacketType = type;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UdpPacket"/> class, with
        /// no payload.
        ///
        /// Header must be populated manually.
        /// </summary>
        /// <param name="type">The type.</param>
        public UdpPacket(EUdpPacketType type)
        {
            this.Header  = new UdpHeader();
            this.Payload = new MemoryStream();

            this.Header.PacketType = type;
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UdpPacket"/> class, of the
 /// specified type containing the first 'length' bytes of specified payload.
 /// 
 /// Header must be populated manually.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="payload">The payload.</param>
 /// <param name="length">The length.</param>
 public UdpPacket(EUdpPacketType type, MemoryStream payload, long length)
     : this(type)
 {
     SetPayload(payload, length);
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UdpPacket"/> class, of the
 /// specified type containing the specified payload.
 /// 
 /// Header must be populated manually.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="payload">The payload.</param>
 public UdpPacket(EUdpPacketType type, MemoryStream payload)
     : this(type)
 {
     SetPayload(payload);
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UdpPacket"/> class, of the
 /// specified type containing the specified payload.
 ///
 /// Header must be populated manually.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="payload">The payload.</param>
 public UdpPacket(EUdpPacketType type, MemoryStream payload)
     : this(type)
 {
     SetPayload(payload);
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UdpPacket"/> class, of the
 /// specified type containing the first 'length' bytes of specified payload.
 ///
 /// Header must be populated manually.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="payload">The payload.</param>
 /// <param name="length">The length.</param>
 public UdpPacket(EUdpPacketType type, MemoryStream payload, long length)
     : this(type)
 {
     SetPayload(payload, length);
 }