(self, sock)
| 7396 | timeout = support.LOOPBACK_TIMEOUT |
| 7397 | |
| 7398 | def echo_server(self, sock): |
| 7399 | def run(sock): |
| 7400 | with sock: |
| 7401 | conn, _ = sock.accept() |
| 7402 | with conn: |
| 7403 | event.wait(self.timeout) |
| 7404 | msg = conn.recv(1024) |
| 7405 | if not msg: |
| 7406 | return |
| 7407 | conn.sendall(msg) |
| 7408 | |
| 7409 | event = threading.Event() |
| 7410 | sock.settimeout(self.timeout) |
| 7411 | thread = threading.Thread(target=run, args=(sock, )) |
| 7412 | thread.start() |
| 7413 | self.addCleanup(thread.join, self.timeout) |
| 7414 | event.set() |
| 7415 | |
| 7416 | def echo_client(self, addr, family): |
| 7417 | with socket.socket(family=family) as sock: |
no test coverage detected