You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.2 KiB
C#

9 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace uPLibrary.Networking.M2Mqtt.Session
{
/// <summary>
/// MQTT Session base class
/// </summary>
public abstract class MqttSession
{
/// <summary>
/// Client Id
/// </summary>
public string ClientId { get; set; }
/// <summary>
/// Messages inflight during session
/// </summary>
public Hashtable InflightMessages { get; set; }
/// <summary>
/// Constructor
/// </summary>
public MqttSession()
: this(null)
{
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="clientId">Client Id to create session</param>
public MqttSession(string clientId)
{
this.ClientId = clientId;
this.InflightMessages = new Hashtable();
}
/// <summary>
/// Clean session
/// </summary>
public virtual void Clear()
{
this.ClientId = null;
this.InflightMessages.Clear();
}
}
}