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

Class ClientProto

Lib/test/test_asyncio/test_sslproto.py:306–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304 sock.close()
305
306 class ClientProto(asyncio.Protocol):
307 def __init__(self, on_data, on_eof):
308 self.on_data = on_data
309 self.on_eof = on_eof
310 self.con_made_cnt = 0
311
312 def connection_made(proto, tr):
313 proto.con_made_cnt += 1
314 # Ensure connection_made gets called only once.
315 self.assertEqual(proto.con_made_cnt, 1)
316
317 def data_received(self, data):
318 self.on_data.set_result(data)
319
320 def eof_received(self):
321 self.on_eof.set_result(True)
322
323 async def client(addr):
324 await asyncio.sleep(0.5)

Callers 1

clientMethod · 0.70

Calls

no outgoing calls

Tested by 1

clientMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…