(self)
| 298 | self._running = new_value |
| 299 | |
| 300 | def run(self): |
| 301 | while self.is_running(): |
| 302 | (sockconn, _) = self.s.accept() |
| 303 | if self.is_running(): |
| 304 | conn = Socks5Connection(self, sockconn) |
| 305 | # Use "daemon" threads, see PR #34863 for more discussion. |
| 306 | thread = threading.Thread(None, conn.handle, daemon=True) |
| 307 | with self._handlers_lock: |
| 308 | conn.handler_index = len(self._handlers) |
| 309 | self._handlers.append((thread, conn)) |
| 310 | assert(conn.handler_index < len(self._handlers)) |
| 311 | thread.start() |
| 312 | |
| 313 | def remove_handler(self, handler_index): |
| 314 | with self._handlers_lock: |
nothing calls this directly
no test coverage detected