<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
This is my code:<br>
ThreadRule is a thread that creates opens a socket. and checks the
flag if the flag is false it will stop<br>
<br>
The GoingUpEvent works but the GoingDownEvent does not. So is it
even the right way to do cleanup for a pox controller?<br>
<br>
class my_l2_learning (EventMixin):<br>
def __init__ (self, port):<br>
self.listenTo(core.openflow)<br>
<br>
self.t = ThreadRule(port)<br>
self.t.start()<br>
#core.addListener(pox.core.GoingUpEvent,
self._handle_GoingUpEvent)<br>
core.addListener(pox.core.GoingDownEvent,
self._handle_GoingDownEvent)<br>
<br>
def _handle_GoingDownEvent (self, event):<br>
self.t.flag=False<br>
print('go down')<br>
def _handle_GoingUpEvent (self, event):<br>
print ("go up")<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 9/6/2012 3:04 PM, Murphy McCauley
wrote:<br>
</div>
<blockquote
cite="mid:CAHC=y9QscxBK2d07dW_TU3vdZwTzjfPKE02W+R=UvdeiArLdKw@mail.gmail.com"
type="cite">
<p>Can you post the code that you tried?</p>
<p>-- Murphy</p>
<div class="gmail_quote">On Sep 6, 2012 2:29 PM, "Masoud Moshref
Javadi" <<a moz-do-not-send="true"
href="mailto:moshrefj@usc.edu">moshrefj@usc.edu</a>> wrote:<br
type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
I want to run a method when the controller goes down to close
a socket.<br>
I tried to register for pox.core.GoingDownEvent but it does
not work. Is there any special way to be informed on the exit
of pox?<br>
<br>
-- <br>
Masoud Moshref Javadi<br>
Computer Engineering PhD Student<br>
Ming Hsieh Department of Electrical Engineering<br>
University of Southern California<br>
<br>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Masoud Moshref Javadi
Computer Engineering PhD Student
Ming Hsieh Department of Electrical Engineering
University of Southern California</pre>
</body>
</html>