Hi,

I just found the solution. I tried your other solution using send_event and
I realized I had the wrong name for the first argument, but after I
replaced it with the right name, the print message appeared.

Thanks,
Yiwen

On Thu, Jan 26, 2017 at 11:43 AM, Yiwen Shen <ys2...@columbia.edu> wrote:

> Hi,
>
> I replaced send_event with send_event_to_observers and now I no longer see
> the EVENT LOST, but the function North_CrossDomainTrafficRequestEvent()
> that is supposed to run when it receives the event is still not running,
> because I don't see the print message. The code for that is :
>
> @set_ev_cls(Custom_event.North_CrossDomainTrafficRequestEvent)
>     def _handle_cross_domain_traffic_request(self,ev):
>         print ("Handling Cross Domain Traffic Request")         # this
> message should be printed if the event was received properly
>
> Thank you,
> Yiwen
>
>
> On Thu, Jan 26, 2017 at 2:27 AM, Iwase Yusuke <iwase.yusu...@gmail.com>
> wrote:
>
>> Hi,
>>
>> How about using "send_event_to_observers" instead?
>>   https://github.com/iwaseyusuke/ryu/blob/master/ryu/base/app_
>> manager.py#L305-L326
>>
>> If you want to use "send_event", the first argument must be the name
>> of RyuApp which is observing the given event.
>> OTOH, "send_event_to_observers" will detects all RyuApp which are
>> observing the given event.
>>
>> Thanks,
>> Iwase
>>
>>
>> On 2017年01月26日 13:28, Yiwen Shen wrote:
>> > Hi,
>> >
>> > I'm trying to start my Ryu system by sending an event from one app to
>> another, but it keeps saying EVENT LOST when I use --verbose. I understand
>> from another thread that we need to wait a bit for the event pipeline to
>> open, so I put hub.sleep(5) but the problem persists.
>> >
>> > My original code was:
>> >
>> > /def start(self):/
>> > /        super(Initialization,self).start()
>> >         new_north_traffic_request_ev = Custom_event.North_CrossDomain
>> TrafficRequestEvent()/
>> > /        hub.sleep(5)/
>> > /        self.send_event('Test', new_north_traffic_request_ev)/
>> >
>> > and inside North_CrossDomainTrafficRequestEvent(), I have a print
>> statement to see if the event was triggered by the sent event but it's not
>> since we have EVENT LOST.
>> > (Specifically it says EVENT LOST Initialization->Test
>> North_CrossDomainTrafficRequestEvent).
>> >
>> > I have also tried separating start into a separate function for the
>> event, and spawning a thread for that event, not sure if that helps, but I
>> still get EVENT LOST:
>> > /
>> > /
>> > /    def _north_request_event(self):/
>> > /        hub.sleep(5)/
>> > /        new_north_traffic_request_ev = Custom_event.North_CrossDomain
>> TrafficRequestEvent()/
>> > /        self.send_event('Test', new_north_traffic_request_ev)/
>> > /
>> > /
>> > /    def start(self):/
>> > /        super(Initialization,self).start()/
>> > /        self.threads.append(hub.spawn(self._north_request_event))/
>> >
>> > Thank you,
>> > Yiwen
>> >
>> >
>> > ------------------------------------------------------------
>> ------------------
>> > Check out the vibrant tech community on one of the world's most
>> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> >
>> >
>> >
>> > _______________________________________________
>> > Ryu-devel mailing list
>> > Ryu-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/ryu-devel
>> >
>>
>
>
>
> --
> *Yiwen Shen*
> PhD Candidate at Lightwave Research Laboratory
> <http://lightwave.ee.columbia.edu/>
>



-- 
*Yiwen Shen*
PhD Candidate at Lightwave Research Laboratory
<http://lightwave.ee.columbia.edu/>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to