(
conn: socket.socket, length: int, loop: AbstractEventLoop
)
| 273 | |
| 274 | |
| 275 | async def _async_socket_receive( |
| 276 | conn: socket.socket, length: int, loop: AbstractEventLoop |
| 277 | ) -> memoryview: |
| 278 | mv = memoryview(bytearray(length)) |
| 279 | bytes_read = 0 |
| 280 | while bytes_read < length: |
| 281 | chunk_length = await loop.sock_recv_into(conn, mv[bytes_read:]) |
| 282 | if chunk_length == 0: |
| 283 | raise OSError("connection closed") |
| 284 | bytes_read += chunk_length |
| 285 | return mv |
| 286 | |
| 287 | |
| 288 | _PYPY = "PyPy" in sys.version |
no outgoing calls
no test coverage detected