当前位置: 首页>>代码示例>>C#>>正文


C# Event.getLastHop方法代码示例

本文整理汇总了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());
                        }
                    }
                }
            }
        }
开发者ID:AndreRog,项目名称:DAD,代码行数:61,代码来源:Broker.cs

示例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);
                    }
                }
            }
        }
开发者ID:AndreRog,项目名称:DAD,代码行数:22,代码来源:Broker.cs


注:本文中的Event.getLastHop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。