Пример #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()));
 }
Пример #2
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()));
 }