[pox-dev] Event handling and listeners

Giannis Sapountzis johnsub1985 at gmail.com
Mon Nov 11 04:31:27 PST 2013


Hello everyone. 

I'm looking for some explanation on event handling in POX. 

Lets say that i have 2 components registered in core with names Component_1 and Component_2. Component_1 raises some event called Event_1.

I want to handle some events in Component_2 both from core.openflow and from core.Component_1.

How should i name the handler methods in Component_2 and how should i register the listeners? Is the following example correct?

In Component_2:

__init__(self):
	core.Component_1.addListeners(self) 
	core.openflow.addListeners(self)

def _handle_openflow_ConnectionUp(self):
	….

def _handle_Component_1_Event_1(self):
	….

Secondly, i only want a component to start handling events afar having received a notification from another component. Can i add the listeners only after i have "caught" an event? Something like the following:

__init__(self):
	core.Component_1.addListeners(self) 

def _handle_Component_1_Event_1(self):
	core.openflow.addListeners(self)

Third, can someone explain to me what the core.listen_to_dependencies does?

Thank you in advance,
John


More information about the pox-dev mailing list