public void FillStatus(MqttClientSessionStatus status)
 {
     status.ClientId        = ClientId;
     status.IsConnected     = _cancellationTokenSource != null;
     status.Endpoint        = _adapterEndpoint;
     status.ProtocolVersion = _adapterProtocolVersion;
     status.PendingApplicationMessagesCount = _pendingPacketsQueue.Count;
     status.LastPacketReceived             = _keepAliveMonitor.LastPacketReceived;
     status.LastNonKeepAlivePacketReceived = _keepAliveMonitor.LastNonKeepAlivePacketReceived;
 }
        public IList <IMqttClientSessionStatus> GetClientStatus()
        {
            var result = new List <IMqttClientSessionStatus>();

            foreach (var session in GetSessions())
            {
                var status = new MqttClientSessionStatus(this, session);
                session.FillStatus(status);

                result.Add(status);
            }

            return(result);
        }