MCPcopy Index your code
hub / github.com/dabeaz-course/python-mastery / echo_handler

Function echo_handler

Solutions/8_6/server.py:60–67  ·  view source on GitHub ↗
(client, address)

Source from the content-addressed store, hash-verified

58 tasks.append(handler(client, addr))
59
60def echo_handler(client, address):
61 print('Connection from', address)
62 while True:
63 data = yield from client.recv(1000)
64 if not data:
65 break
66 yield from client.send(b'GOT:' + data)
67 print('Connection closed')
68
69if __name__ == '__main__':
70 tasks.append(tcp_server(('',25000), echo_handler))

Callers

nothing calls this directly

Calls 2

recvMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected