(sock)
| 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 |