本文整理汇总了C#中ISocket.Disconnect方法的典型用法代码示例。如果您正苦于以下问题:C# ISocket.Disconnect方法的具体用法?C# ISocket.Disconnect怎么用?C# ISocket.Disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISocket
的用法示例。
在下文中一共展示了ISocket.Disconnect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnregisterRoute
private bool UnregisterRoute(IMessage message, ISocket scaleOutBackend)
{
var shouldHandle = IsUnregisterRouting(message);
if (shouldHandle)
{
var payload = message.GetPayload<UnregisterNodeMessageRouteMessage>();
externalRoutingTable.RemoveNodeRoute(new SocketIdentifier(payload.SocketIdentity));
try
{
scaleOutBackend.Disconnect(new Uri(payload.Uri));
}
catch (EndpointNotFoundException)
{
}
}
return shouldHandle;
}
示例2: MessageReceiveLoopOnException
private void MessageReceiveLoopOnException(ISocket socket, Exception exception)
{
try { ResponseException(socket, exception); }
catch { }
socket.Disconnect();
}
示例3: ForwardMessageAway
private bool ForwardMessageAway(MessageIdentifier messageIdentifier, Message message, ISocket scaleOutBackend)
{
var handlers = ((message.Distribution == DistributionPattern.Unicast)
? new[] {externalRoutingTable.FindRoute(messageIdentifier)}
: (MessageCameFromLocalActor(message)
? externalRoutingTable.FindAllRoutes(messageIdentifier)
: Enumerable.Empty<Node>()))
.Where(h => h != null)
.ToList();
foreach (var handler in handlers)
{
try
{
message.SetSocketIdentity(handler.SocketIdentity);
message.PushRouterAddress(routerConfiguration.ScaleOutAddress);
scaleOutBackend.SendMessage(message);
messageTracer.ForwardedToOtherNode(message);
}
catch (HostUnreachableException err)
{
externalRoutingTable.RemoveNodeRoute(new SocketIdentifier(handler.SocketIdentity));
scaleOutBackend.Disconnect(handler.Uri);
logger.Error(err);
}
}
return handlers.Any();
}
示例4: MessageReceiveLoopOnException
private void MessageReceiveLoopOnException(ISocket socket, Exception exception)
{
socket.Disconnect();
}