예제 #1
0
 def _start_server(cls, socket_handler):
     ready_event = threading.Event()
     cls.server_thread = SocketServerThread(socket_handler=socket_handler,
                                            ready_event=ready_event,
                                            host=cls.host)
     cls.server_thread.start()
     ready_event.wait()
     cls.port = cls.server_thread.port
예제 #2
0
파일: testcase.py 프로젝트: eteq/urllib3
    def _start_server(cls, socket_handler):
        ready_lock = Lock()
        ready_lock.acquire()
        cls.server_thread = SocketServerThread(socket_handler=socket_handler,
                                               ready_lock=ready_lock,
                                               host=cls.host, port=cls.port)
        cls.server_thread.start()

        # Lock gets released by thread above
        ready_lock.acquire()
예제 #3
0
 def _start_server(cls, socket_handler):
     ready_event = threading.Event()
     cls.server_thread = SocketServerThread(socket_handler=socket_handler,
                                            ready_event=ready_event,
                                            host=cls.host)
     cls.server_thread.start()
     ready_event.wait(5)
     if not ready_event.is_set():
         raise Exception("most likely failed to start server")
     cls.port = cls.server_thread.port
예제 #4
0
 def _start_server(cls, socket_handler: Callable[[socket.socket], None]) -> None:
     ready_event = threading.Event()
     cls.server_thread = SocketServerThread(
         socket_handler=socket_handler, ready_event=ready_event, host=cls.host
     )
     cls.server_thread.USE_IPV6 = False
     cls.server_thread.start()
     ready_event.wait(5)
     if not ready_event.is_set():
         raise Exception("most likely failed to start server")
     cls.port = cls.server_thread.port