public void FillStatus(MqttSessionStatus status)
 {
     status.ClientId         = ClientId;
     status.CreatedTimestamp = _createdTimestamp;
     status.PendingApplicationMessagesCount = ApplicationMessagesQueue.Count;
     status.Items = Items;
 }
Exemple #2
0
        public Task <IList <IMqttSessionStatus> > GetSessionStatusAsync()
        {
            var result = new List <IMqttSessionStatus>();

            foreach (var session in _sessions.Values)
            {
                var sessionStatus = new MqttSessionStatus(session, this);
                session.FillStatus(sessionStatus);

                result.Add(sessionStatus);
            }

            return(Task.FromResult((IList <IMqttSessionStatus>)result));
        }
        public Task <IList <MqttSessionStatus> > GetSessionStatusAsync()
        {
            var result = new List <MqttSessionStatus>();

            lock (_sessionsManagementLock)
            {
                foreach (var sessionItem in _sessions)
                {
                    var sessionStatus = new MqttSessionStatus(sessionItem.Value);
                    result.Add(sessionStatus);
                }
            }

            return(Task.FromResult((IList <MqttSessionStatus>)result));
        }
Exemple #4
0
        public Task <IList <IMqttClientStatus> > GetClientStatusAsync()
        {
            var result = new List <IMqttClientStatus>();

            foreach (var connection in _connections.Values)
            {
                var clientStatus = new MqttClientStatus(connection);
                connection.FillStatus(clientStatus);

                var sessionStatus = new MqttSessionStatus(connection.Session, this);
                connection.Session.FillStatus(sessionStatus);
                clientStatus.Session = sessionStatus;

                result.Add(clientStatus);
            }

            return(Task.FromResult((IList <IMqttClientStatus>)result));
        }