Delegate CacheClientConnectivityChangedCallback
Defines a callback method for notifying the application about the status of cache client connectivity.
Namespace:
Assembly: Alachisoft.NCache.Runtime.dll
Syntax
public delegate void CacheClientConnectivityChangedCallback(string cacheId, ClientInfo client);
Parameters
Type | Name | Description |
---|---|---|
System.String | cacheId | Name of the Cache. |
Alachisoft.NCache.Runtime.Caching.ClientInfo | client | Information about Cache Client. |
Examples
The following example demonstrates how to use the CacheClientConnectivityChangedCallback class to notify an application when there is change in client connectivity of the cache. You could include this code in a code declaration block in the Web Forms page, or in a page code-behind file.
public void OnCacheClientConnectivityChanged(string cacheId, ClientInfo client)
{
// ...
}
protected void Application_Start(object sender, EventArgs e)
{
try
{
ICache cache = CacheManager.GetCache("myCache");
cache.NotificationService.CacheClientConnectivityChanged += new CacheClientConnectivityChangedCallback(this.OnCacheClientConnectivityChanged);
}
catch (Exception ex)
{
}
}