Read up to len(b) bytes into the writable buffer *b* and return the number of bytes read. If the socket is non-blocking and no bytes are available, None is returned. If *b* is non-empty, a 0 return value indicates that the connection was shutdown at the other e
(self, b)
| 690 | self._timeout_occurred = False |
| 691 | |
| 692 | def readinto(self, b): |
| 693 | """Read up to len(b) bytes into the writable buffer *b* and return |
| 694 | the number of bytes read. If the socket is non-blocking and no bytes |
| 695 | are available, None is returned. |
| 696 | |
| 697 | If *b* is non-empty, a 0 return value indicates that the connection |
| 698 | was shutdown at the other end. |
| 699 | """ |
| 700 | self._checkClosed() |
| 701 | self._checkReadable() |
| 702 | if self._timeout_occurred: |
| 703 | raise OSError("cannot read from timed out object") |
| 704 | while True: |
| 705 | try: |
| 706 | return self._sock.recv_into(b) |
| 707 | except timeout: |
| 708 | self._timeout_occurred = True |
| 709 | raise |
| 710 | except error as e: |
| 711 | if e.errno in _blocking_errnos: |
| 712 | return None |
| 713 | raise |
| 714 | |
| 715 | def write(self, b): |
| 716 | """Write the given bytes or bytearray object *b* to the socket |
nothing calls this directly
no test coverage detected