本文整理汇总了C#中ISender.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# ISender.Equals方法的具体用法?C# ISender.Equals怎么用?C# ISender.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISender
的用法示例。
在下文中一共展示了ISender.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleData
public void HandleData(MemBlock packet, ISender from, object node)
{
_message_count++;
long stop_time, rt_ticks = -10000;
if ( !from.Equals(node)) {
if (packet[0] == 0) {
//log.Debug("Echo Response:");
stop_time = System.DateTime.Now.Ticks;
int received_uid = NumberSerializer.ReadInt(packet, 1);
if(uid_starttime.ContainsKey(received_uid)){
rt_ticks = stop_time - (long)EchoTester.uid_starttime[received_uid];
}
double rt_ms = (double) rt_ticks/10000.0;
uid_brunetpingtime.Add(received_uid, rt_ms);
Console.WriteLine("Packet ID = {0}, Round-trip = {1}", received_uid, rt_ms);
}
else {
//log.Debug("Echo Request:");
}
//log.Debug(packet.ToString());
//System.Console.WriteLine("{0}", packet.ToString());
if (packet[0] > 0) {
//Send a reply back, this is a request
byte[] new_payload = new byte[ packet.Length ];
packet.CopyTo(new_payload, 0);
new_payload[0] = (byte) 0;
from.Send(new CopyList(PType.Protocol.Echo, MemBlock.Reference(new_payload)));
}
}
}