Beispiel #1
0
 public ConnAckPacket(bool sessionPresent, ConnectReturnCode returnCode)
     : base(new ConnAckVariableHeader(sessionPresent, returnCode), new PayloadNone())
 {
     FixedHeader = FixedHeader.CreateStandardHeader(ControlPacketType.CONNACK, (UInt16)(VariableHeader.Encode().Count() + Payload.Encode().Count()));
 }
Beispiel #2
0
 protected ControlPacket(VariableHeader vh, Payload pl)
 {
     VariableHeader = vh;
     Payload        = pl;
 }
Beispiel #3
0
 public IEnumerable <byte> Encode()
 {
     return(FixedHeader.Encode()
            .Concat(VariableHeader.Encode())
            .Concat(Payload.Encode()));
 }
Beispiel #4
0
 public ConnectPacket(string clientID, Will w, Authentication auth, bool cleanSession, UInt16 keepAliveTime)
     : base(new ConnectVariableHeader(w, auth, cleanSession, keepAliveTime), new ConnectPayload(clientID, w, auth))
 {
     FixedHeader = FixedHeader.CreateStandardHeader(ControlPacketType.CONNECT, (UInt16)(VariableHeader.Encode().Count() + Payload.Encode().Count()));
 }