Skip to content

examples: announce readiness after the socket is bound - #66

Merged
mattrobenolt merged 1 commit into
mainfrom
fix/h3-example-ready
Nov 29, 2026
Merged

mattrobenolt merged 1 commit into
mainfrom
fix/h3-example-ready

Conversation

@mattrobenolt

Copy link
Copy Markdown
Member

Found while running h3spec against the example: the harness waited for http3: serving 127.0.0.1:8443 before connecting, and that line printed before address.bind, so the wait raced the bind. With a leftover server on the port the run produced cascading AddressInUse cases, and the workaround was to poll ss -lun for the port instead.

The example now prints once, after bind and listen both succeed. Anything watching the log for readiness sees a port that answers.

zig build example-http3-bin passes; just lint and zig fmt --check are clean.

The example printed `http3: serving 127.0.0.1:8443` before it called
`address.bind`. Anything that waited for that line before connecting raced the
bind: h3spec's harness did, saw `AddressInUse` cascades from a leftover
server, and had to poll the bound port instead.

The line now prints once, after `bind` and `listen` have both succeeded.
@mattrobenolt
mattrobenolt merged commit c14c759 into main Nov 29, 2026
7 checks passed
@mattrobenolt
mattrobenolt deleted the fix/h3-example-ready branch November 29, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant