Send an admin message (LIST_INSTANCES, SET_DEFAULT) without retry. Args: message: Message dict to send. Returns: Response dict from relay server. Raises: ConnectionError: If cannot connect to relay server. ProtocolError: For
(self, message: dict[str, Any])
| 418 | self._version_info_called = True |
| 419 | |
| 420 | def _send_admin_message(self, message: dict[str, Any]) -> dict[str, Any]: |
| 421 | """Send an admin message (LIST_INSTANCES, SET_DEFAULT) without retry. |
| 422 | |
| 423 | Args: |
| 424 | message: Message dict to send. |
| 425 | |
| 426 | Returns: |
| 427 | Response dict from relay server. |
| 428 | |
| 429 | Raises: |
| 430 | ConnectionError: If cannot connect to relay server. |
| 431 | ProtocolError: For protocol errors. |
| 432 | """ |
| 433 | sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| 434 | |
| 435 | try: |
| 436 | try: |
| 437 | sock.settimeout(self.timeout) |
| 438 | sock.connect((self.host, self.port)) |
| 439 | except OSError as e: |
| 440 | raise ConnectionError( |
| 441 | f"Cannot connect to Relay Server at {self.host}:{self.port}", |
| 442 | "CONNECTION_FAILED", |
| 443 | ) from e |
| 444 | |
| 445 | self._write_frame(sock, message) |
| 446 | return self._read_frame(sock) |
| 447 | |
| 448 | finally: |
| 449 | sock.close() |
| 450 | |
| 451 | def list_instances(self) -> list[dict[str, Any]]: |
| 452 | """List all connected Unity instances. |
no test coverage detected