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