Example #1
0
 def open(self):
     print("WebSocket opened")
     port = self.settings['port']
     queue = self.settings['commands_queue']
     self.tcp_client = FlashlightClient(queue, client=self, port=port)
     yield self.tcp_client.connect()
     ioloop.IOLoop.current().spawn_callback(self.tcp_client.flashlight)
     self.write_message("tcp opened")
Example #2
0
def console_only():
    queue = CommandQueue()
    console_view = ConsoleView()
    client = FlashlightClient(queue, console_view, options.port)
    IOLoop.current().spawn_callback(queue.process_command)
    IOLoop.current().run_sync(client.connect)
    console_view.write_message("tcp opened")
    IOLoop.current().spawn_callback(client.flashlight)
    IOLoop.current().start()