Exemplo n.º 1
0
 public IEnumerable <byte> Encode()
 {
     return(FixedHeader.Encode()
            .Concat(VariableHeader.Encode())
            .Concat(Payload.Encode()));
 }
Exemplo n.º 2
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()));
 }
Exemplo n.º 3
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()));
 }