Convenience function that receives a packet from the passed handler and handles error codes. If the process has been shut down, None is returned.
(self)
| 298 | self.windivert.close() |
| 299 | |
| 300 | def recv(self) -> pydivert.Packet | None: |
| 301 | """ |
| 302 | Convenience function that receives a packet from the passed handler and handles error codes. |
| 303 | If the process has been shut down, None is returned. |
| 304 | """ |
| 305 | try: |
| 306 | return self.windivert.recv() |
| 307 | except OSError as e: |
| 308 | if e.winerror == 995: # type: ignore |
| 309 | return None |
| 310 | else: |
| 311 | raise |
| 312 | |
| 313 | |
| 314 | class RedirectLocal(Redirect): |
no outgoing calls
no test coverage detected