(self)
| 196 | return not self._paused and not self._closing |
| 197 | |
| 198 | def pause_reading(self): |
| 199 | if self._closing or self._paused: |
| 200 | return |
| 201 | self._paused = True |
| 202 | |
| 203 | # bpo-33694: Don't cancel self._read_fut because cancelling an |
| 204 | # overlapped WSASend() loss silently data with the current proactor |
| 205 | # implementation. |
| 206 | # |
| 207 | # If CancelIoEx() fails with ERROR_NOT_FOUND, it means that WSASend() |
| 208 | # completed (even if HasOverlappedIoCompleted() returns 0), but |
| 209 | # Overlapped.cancel() currently silently ignores the ERROR_NOT_FOUND |
| 210 | # error. Once the overlapped is ignored, the IOCP loop will ignores the |
| 211 | # completion I/O event and so not read the result of the overlapped |
| 212 | # WSARecv(). |
| 213 | |
| 214 | if self._loop.get_debug(): |
| 215 | logger.debug("%r pauses reading", self) |
| 216 | |
| 217 | def resume_reading(self): |
| 218 | if self._closing or not self._paused: |
no test coverage detected