Write the specified data to the socket. A Timeout exception will be raised if the operation is not completed by the expiration time.
(sock, data, expiration)
| 1098 | |
| 1099 | |
| 1100 | def _net_write(sock, data, expiration): |
| 1101 | """Write the specified data to the socket. |
| 1102 | A Timeout exception will be raised if the operation is not completed |
| 1103 | by the expiration time. |
| 1104 | """ |
| 1105 | current = 0 |
| 1106 | l = len(data) |
| 1107 | while current < l: |
| 1108 | try: |
| 1109 | current += sock.send(data[current:]) |
| 1110 | except (BlockingIOError, ssl.SSLWantWriteError): |
| 1111 | _wait_for_writable(sock, expiration) |
| 1112 | except ssl.SSLWantReadError: # pragma: no cover |
| 1113 | _wait_for_readable(sock, expiration) |
| 1114 | |
| 1115 | |
| 1116 | def send_tcp( |
no test coverage detected
searching dependent graphs…