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

Class ServerProto

Lib/test/test_asyncio/test_ssl.py:984–1004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

982 sock.close()
983
984 class ServerProto(asyncio.Protocol):
985 def __init__(self, on_con, on_eof, on_con_lost):
986 self.on_con = on_con
987 self.on_eof = on_eof
988 self.on_con_lost = on_con_lost
989 self.data = b''
990
991 def connection_made(self, tr):
992 self.on_con.set_result(tr)
993
994 def data_received(self, data):
995 self.data += data
996
997 def eof_received(self):
998 self.on_eof.set_result(1)
999
1000 def connection_lost(self, exc):
1001 if exc is None:
1002 self.on_con_lost.set_result(None)
1003 else:
1004 self.on_con_lost.set_exception(exc)
1005
1006 async def main(proto, on_con, on_eof, on_con_lost):
1007 tr = await on_con

Callers 1

run_mainMethod · 0.70

Calls

no outgoing calls

Tested by 1

run_mainMethod · 0.56