()
| 127 | # (default 8080) before spawning the backend; a self-hosted server's --port wins. |
| 128 | # Changing it needs a restart — the socket is bound at startup. |
| 129 | def get_port() -> int: |
| 130 | with _LOCK: |
| 131 | v = _num(_ensure().get("port")) |
| 132 | return max(_PORT_MIN, min(_PORT_MAX, v)) if v is not None else DEFAULT_PORT |
| 133 | |
| 134 | |
| 135 | def set_port(value: int) -> int: |
no test coverage detected