diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index 2ae2bd7..2492fd2 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -102,10 +102,12 @@
         self.listen_socket = None
         self.switch_socket = None
         self.switch_addr = None
-        self.socs = []
         self.connect_cv = Condition()
         self.message_cv = Condition()
 
+        # Pipe used to wake up event loop
+        self.pipe_rd, self.pipe_wr = os.pipe()
+
         # Counters
         self.socket_errors = 0
         self.parse_errors = 0
@@ -296,7 +298,6 @@
             except:
                 self.logger.warning("Error on listen socket accept")
                 return -1
-            self.socs.append(sock)
             self.logger.info(self.host+":"+str(self.port)+": Incoming connection from "+str(addr))
 
             with self.connect_cv:
@@ -328,6 +329,8 @@
                 return -1
 
             self._pkt_handle(pkt)
+        elif s and s == self.pipe_rd:
+            os.read(s, 1)
         else:
             self.logger.error("Unknown socket ready: " + str(s))
             return -1
@@ -352,6 +355,19 @@
                               (self.switch, self.port, str(e)))
         return None
 
+    def wakeup(self):
+        """
+        Wake up the event loop, presumably from another thread.
+        """
+        os.write(self.pipe_wr, "x")
+
+    def sockets(self):
+        """
+        Return list of sockets to select on.
+        """
+        socs = [self.listen_socket, self.switch_socket, self.pipe_rd]
+        return [x for x in socs if x]
+
     def run(self):
         """
         Activity function for class
@@ -381,13 +397,12 @@
             self.listen_socket.listen(LISTEN_QUEUE_SIZE)
 
             self.logger.info("Listening for switch connection")
-            self.socs = [self.listen_socket]
             self.dbg_state = "running"
 
         while self.active:
             try:
                 sel_in, sel_out, sel_err = \
-                    select.select(self.socs, [], self.socs, 1)
+                    select.select(self.sockets(), [], self.sockets(), 1)
             except:
                 print sys.exc_info()
                 self.logger.error("Select error, disconnecting")
@@ -420,9 +435,9 @@
             soc = self.active_connect()
             if soc:
                 self.logger.info("Connected to %s", self.switch)
-                self.socs = [soc]
                 self.dbg_state = "running"
                 self.switch_socket = soc
+                self.wakeup()
                 with self.connect_cv:
                     if self.initial_hello:
                         self.message_send(hello())
@@ -443,7 +458,6 @@
         If connected to a switch, disconnect.
         """
         if self.switch_socket:
-            self.socs.remove(self.switch_socket)
             self.switch_socket.close()
             self.switch_socket = None
             self.switch_addr = None
@@ -472,6 +486,7 @@
         the select timeout to kick in
         """
         self.active = False
+        self.wakeup()
 
     def shutdown(self):
         """
@@ -500,6 +515,7 @@
         with self.connect_cv:
             self.connect_cv.notifyAll()
 
+        self.wakeup()
         self.dbg_state = "down"
 
     def register(self, msg_type, handler):
