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

Method serve

Lib/test/test_asyncio/test_sslproto.py:291–304  ·  view source on GitHub ↗
(sock)

Source from the content-addressed store, hash-verified

289 client_context = test_utils.simple_client_sslcontext()
290
291 def serve(sock):
292 sock.settimeout(self.TIMEOUT)
293
294 data = sock.recv_all(len(HELLO_MSG))
295 self.assertEqual(len(data), len(HELLO_MSG))
296
297 sock.start_tls(server_context, server_side=True)
298
299 sock.sendall(b'O')
300 data = sock.recv_all(len(HELLO_MSG))
301 self.assertEqual(len(data), len(HELLO_MSG))
302
303 sock.shutdown(socket.SHUT_RDWR)
304 sock.close()
305
306 class ClientProto(asyncio.Protocol):
307 def __init__(self, on_data, on_eof):

Callers

nothing calls this directly

Calls 8

settimeoutMethod · 0.45
recv_allMethod · 0.45
assertEqualMethod · 0.45
start_tlsMethod · 0.45
sendallMethod · 0.45
shutdownMethod · 0.45
closeMethod · 0.45
call_soon_threadsafeMethod · 0.45

Tested by

no test coverage detected