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

Method eof_server

Lib/test/test_asyncio/test_ssl.py:1370–1384  ·  view source on GitHub ↗
(sock)

Source from the content-addressed store, hash-verified

1368 sock.close()
1369
1370 def eof_server(sock):
1371 sock.starttls(sslctx, server_side=True)
1372 self.assertEqual(sock.recv_all(4), b'ping')
1373 sock.send(b'pong')
1374
1375 time.sleep(0.2) # wait for the peer to fill its backlog
1376
1377 # send EOF
1378 sock.shutdown(socket.SHUT_WR)
1379
1380 # should receive all data
1381 data = sock.recv_all(CHUNK * SIZE)
1382 self.assertEqual(len(data), CHUNK * SIZE)
1383
1384 sock.close()
1385
1386 async def client(addr):
1387 nonlocal future

Callers

nothing calls this directly

Calls 7

starttlsMethod · 0.45
assertEqualMethod · 0.45
recv_allMethod · 0.45
sendMethod · 0.45
sleepMethod · 0.45
shutdownMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected