(address, client_sock)
| 3 | from socket import socket, AF_INET, SOCK_STREAM |
| 4 | |
| 5 | def echo_handler(address, client_sock): |
| 6 | print('Got connection from {}'.format(address)) |
| 7 | while True: |
| 8 | msg = client_sock.recv(8192) |
| 9 | if not msg: |
| 10 | break |
| 11 | client_sock.sendall(msg) |
| 12 | client_sock.close() |
| 13 | |
| 14 | def echo_server(address, backlog=5): |
| 15 | sock = socket(AF_INET, SOCK_STREAM) |
no test coverage detected