本文整理汇总了C#中Event.getLastHop方法的典型用法代码示例。如果您正苦于以下问题:C# Event.getLastHop方法的具体用法?C# Event.getLastHop怎么用?C# Event.getLastHop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Event
的用法示例。
在下文中一共展示了Event.getLastHop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: floodNoOrder
public void floodNoOrder(Event e)
{
Console.WriteLine("Flooding Started");
string lastHop = e.getLastHop();
e.setLastHop(this.myUrl);
if (lastHop.Equals("null"))
{
if (! (parentURL.Equals("null")))
{
IBroker parent = (IBroker)Activator.GetObject(
typeof(IBroker),
this.parentURL);
parent.receivePub(e.getSender(), e);
sendToPM("BroEvent " + name + " , " + e.getSender() + " , " + e.getTopic() + " , " + e.getNumber());
}
if (!(childs.Count == 0))
{
foreach (string childurl in childs.Values)
{
IBroker child = (IBroker)Activator.GetObject(
typeof(IBroker),
childurl);
child.receivePub(e.getSender(), e);
sendToPM("BroEvent " + name + " , " + e.getSender() + " , " + e.getTopic() + " , " + e.getNumber());
}
}
}
else
{
if (!(this.parentURL.Equals("null")) && !(this.parentURL.Equals(lastHop)))
{
IBroker parent = (IBroker)Activator.GetObject(
typeof(IBroker),
this.parentURL);
parent.receivePub(e.getSender(), e);
sendToPM("BroEvent " + name + " , " + e.getSender() + " , " + e.getTopic() + " , " + e.getNumber());
}
if (!(childs.Count == 0))
{
foreach (string childurl in childs.Values)
{
if (!(childurl.Equals(lastHop)))
{
IBroker child = (IBroker)Activator.GetObject(
typeof(IBroker),
childurl);
child.receivePub(e.getSender(), e);
sendToPM("BroEvent " + name + " , " + e.getSender() + " , " + e.getTopic() + " , " + e.getNumber());
}
}
}
}
}
示例2: floodFiltered
public void floodFiltered(Event e)
{
//ok stop it right
string lastHop = e.getLastHop();
e.setLastHop(this.myUrl);
foreach (KeyValuePair<string,string> kvp in filteringInterest)
{
//&& kvp.Value.Equals(this.myUrl)
if (kvp.Key.Equals(e.getTopic()))
{
if (!lastHop.Equals(kvp.Value))
{
Console.WriteLine("Filtering to:" + kvp.Value);
IBroker broker = (IBroker)Activator.GetObject(
typeof(IBroker),
kvp.Value);
broker.receivePub(e.getSender(),e);
}
}
}
}