/// <summary> /// Acquires a new MQTT packet from the pool. /// </summary> /// <returns></returns> public static MqttConnackPacket Acquire(MqttConnackStatus type, bool sessionPresent) { var packet = Pool.Acquire(); packet.ReturnCode = type; packet.SessionPresent = sessionPresent; return(packet); }
/// <summary> /// Recycles the packet. /// </summary> public override void Recycle() { // Call the base base.Recycle(); // Recycle the properties this.ReturnCode = MqttConnackStatus.RefusedNotAuthorized; }
public static void SendMqttConack(this IClient client, MqttConnackStatus status, bool sessionPresent) { client.Send( MqttConnackPacket.Acquire(status, sessionPresent) ); }