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

Method server

Lib/test/test_asyncio/test_streams.py:942–948  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

940 q = queue.Queue()
941
942 def server():
943 # Runs in a separate thread.
944 with socket.create_server(('localhost', 0)) as sock:
945 addr = sock.getsockname()
946 q.put(addr)
947 clt, _ = sock.accept()
948 clt.close()
949
950 async def client(host, port):
951 reader, writer = await asyncio.open_connection(host, port)

Callers

nothing calls this directly

Calls 5

create_serverMethod · 0.45
getsocknameMethod · 0.45
putMethod · 0.45
acceptMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected