From bab636bc89584b3bb2baaa5bc766be82fb81d1b2 Mon Sep 17 00:00:00 2001 From: Murphy McCauley Date: Sun, 13 Oct 2013 17:07:18 -0700 Subject: [PATCH] of_01: Ensure task is only started once --- pox/openflow/of_01.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pox/openflow/of_01.py b/pox/openflow/of_01.py index 3fe5f5f16..01ceabff8 100644 --- a/pox/openflow/of_01.py +++ b/pox/openflow/of_01.py @@ -835,12 +835,19 @@ def __init__ (self, port = 6633, address = '0.0.0.0'): Task.__init__(self) self.port = int(port) self.address = address + self.started = False core.addListener(pox.core.GoingUpEvent, self._handle_GoingUpEvent) def _handle_GoingUpEvent (self, event): self.start() + def start (self): + if self.started: + return + self.started = True + return super(OpenFlow_01_Task,self).start() + def run (self): # List of open sockets/connections to select on sockets = []