MCPcopy Index your code
hub / github.com/python/cpython / client

Method client

Lib/test/test_asyncio/test_server.py:25–37  ·  view source on GitHub ↗
(sock, addr)

Source from the content-addressed store, hash-verified

23 HELLO_MSG = b'1' * 1024 * 5 + b'\n'
24
25 def client(sock, addr):
26 for i in range(10):
27 time.sleep(0.2)
28 if srv.is_serving():
29 break
30 else:
31 raise RuntimeError
32
33 sock.settimeout(2)
34 sock.connect(addr)
35 sock.send(HELLO_MSG)
36 sock.recv_all(1)
37 sock.close()
38
39 async def serve(reader, writer):
40 await reader.readline()

Callers

nothing calls this directly

Calls 7

sleepMethod · 0.45
is_servingMethod · 0.45
settimeoutMethod · 0.45
connectMethod · 0.45
sendMethod · 0.45
recv_allMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected