Exemple #1
0
 public static void LogClientActivity(string method, string activity)
 {
     if (_monitor)
     {
         ClientMonitor cMonitor = _threadClientMap[Thread.CurrentThread.ManagedThreadId] as ClientMonitor;
         if (cMonitor != null)
         {
             cMonitor.LogActivity(method, activity);
         }
     }
 }
Exemple #2
0
 public static void RegisterClient(string clientID, string address)
 {
     if (clientID == null) return;
     lock (_clientActivity.SyncRoot)
     {
         if (!_clientActivity.Contains(clientID))
         {
             ClientMonitor clientActivity = new ClientMonitor(clientID, address);
             _clientActivity.Add(clientID, clientActivity);
         }
     }
 }
Exemple #3
0
 public static void RegisterClient(string clientID, string address)
 {
     if (clientID == null)
     {
         return;
     }
     lock (_clientActivity.SyncRoot)
     {
         if (!_clientActivity.Contains(clientID))
         {
             ClientMonitor clientActivity = new ClientMonitor(clientID, address);
             _clientActivity.Add(clientID, clientActivity);
         }
     }
 }
Exemple #4
0
        public static Hashtable GetCurrentClientActivity()
        {
            Hashtable activityTable = new Hashtable();

            lock (_clientActivity.SyncRoot)
            {
                IDictionaryEnumerator ide = _clientActivity.GetEnumerator();

                while (ide.MoveNext())
                {
                    ClientMonitor cMonitor = ide.Value as ClientMonitor;
                    activityTable.Add(cMonitor.Info, cMonitor.GetCurrentClientActivities());
                }
            }
            return(activityTable);
        }
Exemple #5
0
        public static void StopClientActivity(string clientId)
        {
            if (_monitor)
            {
                ClientMonitor cMonitor = _clientActivity[clientId] as ClientMonitor;
                if (cMonitor != null)
                {
                    cMonitor.StopActivity();
                }
                int tId = Thread.CurrentThread.ManagedThreadId;

                lock (_threadClientMap.SyncRoot)
                {
                    _threadClientMap.Remove(tId);
                }
            }
        }
Exemple #6
0
        public static void StartClientActivity(string clientId)
        {
            if (clientId == null)
            {
                return;
            }
            if (_monitor)
            {
                ClientMonitor cMonitor = _clientActivity[clientId] as ClientMonitor;
                if (cMonitor != null)
                {
                    cMonitor.StartActivity();
                }
                int tId = Thread.CurrentThread.ManagedThreadId;

                lock (_threadClientMap.SyncRoot)
                {
                    _threadClientMap[tId] = cMonitor;
                }
            }
        }