MCPcopy Index your code
hub / github.com/RustPython/RustPython / eof_server

Method eof_server

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

Source from the content-addressed store, hash-verified

1377 sock.close()
1378
1379 def eof_server(sock):
1380 sock.starttls(sslctx, server_side=True)
1381 self.assertEqual(sock.recv_all(4), b'ping')
1382 sock.send(b'pong')
1383
1384 time.sleep(0.2) # wait for the peer to fill its backlog
1385
1386 # send EOF
1387 sock.shutdown(socket.SHUT_WR)
1388
1389 # should receive all data
1390 data = sock.recv_all(CHUNK * SIZE)
1391 self.assertEqual(len(data), CHUNK * SIZE)
1392
1393 sock.close()
1394
1395 async def client(addr):
1396 nonlocal future

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
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