Example #1
0
 public static FixedHeader CreateStandardHeader(ControlPacketType type, UInt32 remainingLength)
 {
     if (type == ControlPacketType.PUBLISH)
     {
         throw new ArgumentException(nameof(type), "There is no defined flag configuration for a PUBLISH control packet.  Use the CreatePublishHeader method to create this header type");
     }
     return(new FixedHeader(type, ControlPacketFlags.GetDefinedFlags(type), remainingLength));
 }
Example #2
0
 public static FixedHeader CreatePublishHeader(bool duplicate, QoSLevel qos, bool retain, UInt32 remainingLength)
 {
     return(new FixedHeader(ControlPacketType.PUBLISH, ControlPacketFlags.GetPublishFlags(duplicate, qos, retain), remainingLength));
 }
Example #3
0
 protected FixedHeader(ControlPacketType type, ControlPacketFlags flags, UInt32 remainingLength = 0)
 {
     Type            = type;
     Flags           = flags;
     RemainingLength = new EncodedRemainingLength(remainingLength);
 }