本文整理汇总了C#中ClusterDescription.WithoutServerDescription方法的典型用法代码示例。如果您正苦于以下问题:C# ClusterDescription.WithoutServerDescription方法的具体用法?C# ClusterDescription.WithoutServerDescription怎么用?C# ClusterDescription.WithoutServerDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClusterDescription
的用法示例。
在下文中一共展示了ClusterDescription.WithoutServerDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveServer
private ClusterDescription RemoveServer(ClusterDescription clusterDescription, EndPoint endPoint, string reason)
{
IClusterableServer server;
var stopwatch = new Stopwatch();
lock (_serversLock)
{
server = _servers.SingleOrDefault(x => EndPointHelper.Equals(x.EndPoint, endPoint));
if (server == null)
{
return clusterDescription;
}
if (_removingServerEventHandler != null)
{
_removingServerEventHandler(new ClusterRemovingServerEvent(server.ServerId, reason));
}
stopwatch.Start();
_servers.Remove(server);
}
server.DescriptionChanged -= ServerDescriptionChangedHandler;
server.Dispose();
stopwatch.Stop();
if (_removedServerEventHandler != null)
{
_removedServerEventHandler(new ClusterRemovedServerEvent(server.ServerId, reason, stopwatch.Elapsed));
}
return clusterDescription.WithoutServerDescription(endPoint);
}
示例2: RemoveServer
private ClusterDescription RemoveServer(ClusterDescription clusterDescription, EndPoint endPoint, string reason)
{
IClusterableServer server;
lock (_serversLock)
{
server = _servers.SingleOrDefault(x => x.EndPoint.Equals(endPoint));
if (server == null)
{
return clusterDescription;
}
if (Listener != null)
{
Listener.ClusterBeforeRemovingServer(server.ServerId, reason);
}
_servers.Remove(server);
}
var stopwatch = new Stopwatch();
server.DescriptionChanged -= ServerDescriptionChangedHandler;
server.Dispose();
stopwatch.Stop();
if (Listener != null)
{
Listener.ClusterAfterRemovingServer(server.ServerId, reason, stopwatch.Elapsed);
}
return clusterDescription.WithoutServerDescription(endPoint);
}