Example #1
0
 public void FillStatus(MqttClientSessionStatus status)
 {
     status.ClientId        = ClientId;
     status.IsConnected     = _adapter != null;
     status.Endpoint        = _adapter?.Endpoint;
     status.ProtocolVersion = _adapter?.PacketSerializer?.ProtocolVersion;
     status.PendingApplicationMessagesCount = _pendingPacketsQueue.Count;
     status.LastPacketReceived             = _keepAliveMonitor.LastPacketReceived;
     status.LastNonKeepAlivePacketReceived = _keepAliveMonitor.LastNonKeepAlivePacketReceived;
 }
Example #2
0
        public Task <IList <IMqttClientSessionStatus> > GetClientStatusAsync()
        {
            var result = new List <IMqttClientSessionStatus>();

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

                result.Add(status);
            }

            return(Task.FromResult((IList <IMqttClientSessionStatus>)result));
        }
        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);
        }