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

Method start_server

Lib/test/test_asyncio/test_ssl.py:260–282  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258 await fut
259
260 async def start_server():
261 srv = await asyncio.start_server(
262 handle_client,
263 '127.0.0.1', 0,
264 family=socket.AF_INET,
265 ssl=sslctx,
266 ssl_handshake_timeout=HANDSHAKE_TIMEOUT)
267
268 try:
269 srv_socks = srv.sockets
270 self.assertTrue(srv_socks)
271
272 addr = srv_socks[0].getsockname()
273
274 tasks = []
275 for _ in range(TOTAL_CNT):
276 tasks.append(test_client(addr))
277
278 await asyncio.wait_for(asyncio.gather(*tasks), TIMEOUT)
279
280 finally:
281 self.loop.call_soon(srv.close)
282 await srv.wait_closed()
283
284 with self._silence_eof_received_warning():
285 self.loop.run_until_complete(start_server())

Callers 14

startMethod · 0.45
start_callbackMethod · 0.45
run_testMethod · 0.45
outerMethod · 0.45
mainMethod · 0.45
testMethod · 0.45
test_start_server_1Method · 0.45
test_wait_closed_raceMethod · 0.45
test_close_clientsMethod · 0.45
test_abort_clientsMethod · 0.45

Calls 8

assertTrueMethod · 0.80
getsocknameMethod · 0.45
appendMethod · 0.45
wait_forMethod · 0.45
gatherMethod · 0.45
call_soonMethod · 0.45
wait_closedMethod · 0.45
create_serverMethod · 0.45

Tested by

no test coverage detected