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

Class ServerProto

Lib/test/test_asyncio/test_ssl.py:980–1000  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

run_mainMethod · 0.70

Calls

no outgoing calls

Tested by 1

run_mainMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…