本文整理汇总了C#中GrainId.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# GrainId.Equals方法的具体用法?C# GrainId.Equals怎么用?C# GrainId.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GrainId
的用法示例。
在下文中一共展示了GrainId.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReceiveSocketPreample
protected bool ReceiveSocketPreample(Socket sock, bool expectProxiedConnection, out GrainId client)
{
client = null;
if (Cts.IsCancellationRequested) return false;
if (!ReadConnectionPreemble(sock, out client))
{
return false;
}
if (Log.IsVerbose2) Log.Verbose2(ErrorCode.MessageAcceptor_Connection, "Received connection from {0} at source address {1}", client, sock.RemoteEndPoint.ToString());
if (expectProxiedConnection)
{
// Proxied Gateway Connection - must have sender id
if (client.Equals(Constants.SiloDirectConnectionId))
{
Log.Error(ErrorCode.MessageAcceptor_NotAProxiedConnection, string.Format("Gateway received unexpected non-proxied connection from {0} at source address {1}", client, sock.RemoteEndPoint));
return false;
}
}
else
{
// Direct connection - should not have sender id
if (!client.Equals(Constants.SiloDirectConnectionId))
{
Log.Error(ErrorCode.MessageAcceptor_UnexpectedProxiedConnection, string.Format("Silo received unexpected proxied connection from {0} at source address {1}", client, sock.RemoteEndPoint));
return false;
}
}
lock (Lockable)
{
OpenReceiveSockets.Add(sock);
}
return true;
}