(self)
| 58 | # ------------------------------------------------------------------ |
| 59 | |
| 60 | def connect(self) -> None: |
| 61 | self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| 62 | self._sock.settimeout(self.timeout) |
| 63 | try: |
| 64 | self._sock.connect((self.host, self.port)) |
| 65 | except (ConnectionRefusedError, socket.timeout) as exc: |
| 66 | raise ConnectionError( |
| 67 | f"Cannot connect to Serial Studio MCP at {self.host}:{self.port}. " |
| 68 | "Ensure Serial Studio is running with API Server enabled." |
| 69 | ) from exc |
| 70 | |
| 71 | def disconnect(self) -> None: |
| 72 | if self._sock: |
no outgoing calls
no test coverage detected