(self, sock)
| 7306 | timeout = support.LOOPBACK_TIMEOUT |
| 7307 | |
| 7308 | def echo_server(self, sock): |
| 7309 | def run(sock): |
| 7310 | with sock: |
| 7311 | conn, _ = sock.accept() |
| 7312 | with conn: |
| 7313 | event.wait(self.timeout) |
| 7314 | msg = conn.recv(1024) |
| 7315 | if not msg: |
| 7316 | return |
| 7317 | conn.sendall(msg) |
| 7318 | |
| 7319 | event = threading.Event() |
| 7320 | sock.settimeout(self.timeout) |
| 7321 | thread = threading.Thread(target=run, args=(sock, )) |
| 7322 | thread.start() |
| 7323 | self.addCleanup(thread.join, self.timeout) |
| 7324 | event.set() |
| 7325 | |
| 7326 | def echo_client(self, addr, family): |
| 7327 | with socket.socket(family=family) as sock: |
no test coverage detected