| 3262 | |
| 3263 | |
| 3264 | class DispatchReader(ReaderThread): |
| 3265 | def __init__(self, dispatcher): |
| 3266 | self.dispatcher = dispatcher |
| 3267 | |
| 3268 | ReaderThread.__init__( |
| 3269 | self, |
| 3270 | get_global_debugger(), |
| 3271 | self.dispatcher.client, |
| 3272 | PyDevJsonCommandProcessor=PyDevJsonCommandProcessor, |
| 3273 | process_net_command=process_net_command, |
| 3274 | ) |
| 3275 | |
| 3276 | @overrides(ReaderThread._on_run) |
| 3277 | def _on_run(self): |
| 3278 | dummy_thread = threading.current_thread() |
| 3279 | dummy_thread.is_pydev_daemon_thread = False |
| 3280 | return ReaderThread._on_run(self) |
| 3281 | |
| 3282 | @overrides(PyDBDaemonThread.do_kill_pydev_thread) |
| 3283 | def do_kill_pydev_thread(self): |
| 3284 | if not self._kill_received: |
| 3285 | ReaderThread.do_kill_pydev_thread(self) |
| 3286 | try: |
| 3287 | self.sock.shutdown(SHUT_RDWR) |
| 3288 | except: |
| 3289 | pass |
| 3290 | try: |
| 3291 | self.sock.close() |
| 3292 | except: |
| 3293 | pass |
| 3294 | |
| 3295 | def process_command(self, cmd_id, seq, text): |
| 3296 | if cmd_id == 99: |
| 3297 | self.dispatcher.port = int(text) |
| 3298 | self._kill_received = True |
| 3299 | |
| 3300 | |
| 3301 | DISPATCH_APPROACH_NEW_CONNECTION = 1 # Used by PyDev |