| 242 | self.handler_index = None |
| 243 | |
| 244 | def wakeup(self): |
| 245 | # Wake up the blocking forwarding select by writing to the wake-up socket |
| 246 | try: |
| 247 | socket_pair = self.wakeup_socket_pair |
| 248 | if socket_pair is not None: |
| 249 | socket_pair[0].send("CloseWakeup".encode()) |
| 250 | logger.debug("Waking up forwarding thread") |
| 251 | except OSError as e: |
| 252 | logger.warning(f"Error waking up forwarding thread: {e}") |
| 253 | pass |
| 254 | |
| 255 | |
| 256 | # Wrapper for thread.join(), which may throw for daemon threads (in late stages of finalization). |