1.1 KiB
1.1 KiB
019 — Default port should be 0
Summary
--port currently defaults to 8420 (Args in main.rs). The wishlist asks for a
default of 0, i.e. let the OS assign an ephemeral free port rather than colliding
with whatever else is running on a fixed port.
Scope
- Change
Args::port's default to0. - After
TcpListener::bindsucceeds, read back the actual bound port (vialistener.local_addr()) since binding to0means the requested port and the real one differ. - Print the real bound port in the startup log line (it already prints
args.port, which would otherwise always read0). - Consider whether the actual port needs to be surfaced anywhere else (e.g. a
GET /api/stats-style endpoint) — not required unless something already depends on knowing it programmatically today; check before adding.
Acceptance criteria
- Running
ottylwith no--portbinds an OS-assigned free port instead of a fixed one, and the startup message prints that actual port. --port <n>still binds the requested fixed port as before.
Depends on
None.