NCache 4.6 - Online Documentation

Viewing List of Clients Connected with a Cache

 
GetCacheClient method in NCache enables the user to get a list of all connected clients on a server node at a given time. This method returns a dictionary containing server names and list of all client nodes connected at that given time.
 
      To utilize the API, include the following namespace in your application: Alachisoft.NCache.Runtime.CacheManagement.
 
 
In this example only the cache name needs to be specified, the API uses client configuration file to connect to the server nodes and collects information; the initial node can also be specified. In case of failure of connection or incorrect cache name, NCache would throw ManagementException.
 
        try
        {
            //Returns list of all clients connected with cache servers
            Dictionary<ServerNode, List<CacheClient>> clientList = CacheManager.GetCacheClients(cacheName);
        }
        catch (ManagementException ex)
        {
            // handle exception
        }
 
 
See Also