MCPcopy Index your code
hub / github.com/RustPython/RustPython / ClientProtoSecond

Class ClientProtoSecond

Lib/test/test_asyncio/test_sslproto.py:460–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 slf.on_data.set_result(bytes(slf.buf[:nsize]))
459
460 class ClientProtoSecond(asyncio.Protocol):
461 def __init__(self, on_data, on_eof):
462 self.on_data = on_data
463 self.on_eof = on_eof
464 self.con_made_cnt = 0
465
466 def connection_made(self, tr):
467 nonlocal client_con_made_calls
468 client_con_made_calls += 1
469
470 def data_received(self, data):
471 self.on_data.set_result(data)
472
473 def eof_received(self):
474 self.on_eof.set_result(True)
475
476 async def client(addr):
477 await asyncio.sleep(0.5)

Callers 1

clientMethod · 0.70

Calls

no outgoing calls

Tested by 1

clientMethod · 0.56