| 72 | | """Flag exception thrown on IDE conn timeout.""" |
| | 72 | """Flag exception thrown on IDE conn timeout.""" |
| | 73 | |
| | 74 | |
| | 75 | def connectToIDECallback(status): |
| | 76 | """Callback to open IDE connection on debug server thread""" |
| | 77 | try: |
| | 78 | if gHttpServer.debugger is not None: |
| | 79 | # temporary try: except: wrapper to work around exception |
| | 80 | # detection in the debugger |
| | 81 | try: |
| | 82 | # Without the following line, the debugger-to-IDE |
| | 83 | # auto-connect fails. It seems some C calls are needed |
| | 84 | # for things to resolve; race condition somewhere? |
| | 85 | # securechannel throws a socket.error (107) if not. |
| | 86 | # Note that the old code (using _v_http_server) would |
| | 87 | # fail too if it weren't for more C calls (through |
| | 88 | # dict lookups) and persistence mechanisms. |
| | 89 | repr(gHttpServer) |
| | 90 | gHttpServer.debugger.ConnectToClient() |
| | 91 | except: |
| | 92 | # bare except, but with re-raise |
| | 93 | raise |
| | 94 | finally: |
| | 95 | status['completed'] = 1 |
| 305 | | |
| 306 | | security.declarePrivate('__do_connect') |
| 307 | | def __do_connect(self, status_dict): |
| 308 | | "Function to try connecting to client; gets run on the debug thread." |
| 309 | | try: |
| 310 | | if self.hasStarted(): |
| 311 | | if gHttpServer.debugger is not None: |
| 312 | | # temporary try: except: wrapper to work around exception |
| 313 | | # detection in the debugger |
| 314 | | try: |
| 315 | | # Without the following line, the debugger-to-IDE |
| 316 | | # auto-connect fails. It seems some C calls are needed |
| 317 | | # for things to resolve; race condition somewhere? |
| 318 | | # securechannel throws a socket.error (107) if not. |
| 319 | | # Note that the old code (using _v_http_server) would |
| 320 | | # fail too if it weren't for more C calls (through |
| 321 | | # dict lookups) and persistence mechanisms. |
| 322 | | repr(gHttpServer) |
| 323 | | gHttpServer.debugger.ConnectToClient() |
| 324 | | except: |
| 325 | | # bare except, but with re-raise |
| 326 | | raise |
| 327 | | finally: |
| 328 | | status_dict['completed'] = 1 |