Ejemplo n.º 1
0
def StartServer(host, port, client_port):
    #replace exit (see comments on method)
    #note that this does not work in jython!!! (sys method can't be replaced).
    sys.exit = _DoExit

    interpreter = InterpreterInterface(host, client_port, threading.currentThread())

    server_thread = threading.Thread(target=start_server,
                                     name='ServerThread',
                                     args=(host, port, interpreter))
    server_thread.setDaemon(True)
    server_thread.start()

    process_exec_queue(interpreter)
Ejemplo n.º 2
0
 def process_request(self, request, client_address):
     """Start a new thread to process the request."""
     t = threading.Thread(target=self.process_request_thread,
                          args=(request, client_address))
     t.daemon = self.daemon_threads
     t.start()