def run_app(sniffer): """Runs the LinkApp on a RedServer for the given sniffer.""" from redfootlib.server import RedServer server = RedServer('', 9090) app = LinkApp(sniffer) server.add_app(app) # Run the server in a thread... otherwise we block on server.run() and # do not get past it until the server stops. Also, set the thread to # be a daemon thread so it goes away when we do. import threading t = threading.Thread(target = server.run, args = ()) t.setDaemon(1) t.start()