(self)
| 1547 | self._server_socket = None |
| 1548 | |
| 1549 | def run(self): |
| 1550 | host = SetupHolder.setup["client"] |
| 1551 | port = SetupHolder.setup["port"] |
| 1552 | |
| 1553 | self._server_socket = create_server_socket(host=host, port=port) |
| 1554 | self.py_db._server_socket_name = self._server_socket.getsockname() |
| 1555 | self.py_db.set_server_socket_ready() |
| 1556 | |
| 1557 | while not self._kill_received: |
| 1558 | try: |
| 1559 | s = self._server_socket |
| 1560 | if s is None: |
| 1561 | return |
| 1562 | |
| 1563 | s.listen(1) |
| 1564 | new_socket, _addr = s.accept() |
| 1565 | if self._kill_received: |
| 1566 | pydev_log.info("Connection (from wait_for_attach) accepted but ignored as kill was already received.") |
| 1567 | return |
| 1568 | |
| 1569 | pydev_log.info("Connection (from wait_for_attach) accepted.") |
| 1570 | reader = getattr(self.py_db, "reader", None) |
| 1571 | if reader is not None: |
| 1572 | # This is needed if a new connection is done without the client properly |
| 1573 | # sending a disconnect for the previous connection. |
| 1574 | api = PyDevdAPI() |
| 1575 | api.request_disconnect(self.py_db, resume_threads=False) |
| 1576 | |
| 1577 | self.py_db.initialize_network(new_socket, terminate_on_socket_close=False) |
| 1578 | |
| 1579 | except: |
| 1580 | if DebugInfoHolder.DEBUG_TRACE_LEVEL > 0: |
| 1581 | pydev_log.exception() |
| 1582 | pydev_log.debug("Exiting _WaitForConnectionThread: %s\n", port) |
| 1583 | |
| 1584 | def do_kill_pydev_thread(self): |
| 1585 | PyDBDaemonThread.do_kill_pydev_thread(self) |
nothing calls this directly
no test coverage detected