## Summary
- Adds a reusable Tokio-native `Server` that binds one UDP listener around one `ServerCore`.
- Adds caller-controlled graceful shutdown and scheduled idle-session maintenance.
- Treats per-packet send failures and short sends as reply loss without terminating the listener.
- Adds real loopback OPEN/ECHO/CLOSE coverage with both raw protocol packets and `irtt-client::AsyncClient`.
## Runtime model
- One sequential core/event loop runs per socket, with no per-datagram tasks or locks.
- Receive and core failures may stop `Server::run`; send failures drop only that reply.
- Explicit-address binds are the source-address-safe supported path.
- Wildcard multi-homed source selection remains future work pending pktinfo support.
## Clean-room / scope
- No upstream source, tests, history, or binaries were inspected or run, and no protocol evidence changed.
- No CLI server applet, DSCP socket policy, or full `ServerFill` policy is included.
## Verification
- `cargo fmt --all -- --check`
- `CARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo check --workspace --all-targets --all-features --locked`
- `CARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo test --workspace --all-targets --all-features --locked`
- `CARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo clippy --workspace --all-targets --all-features --locked -- -D warnings`
- `RUSTDOCFLAGS="-D warnings" CARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo doc -p irtt-proto -p irtt-client -p irtt-server --all-features --no-deps`
- `cargo tree -p irtt-server --edges normal`
- `git diff --check main...HEAD`
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### 💡 Codex Review
Here are some automated review suggestions for this pull request.
**Reviewed commit:** `85c432fcf8`
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
This new runtime-maintenance rule contradicts the later section of the same scoped guidance, which still says expiry is packet-driven until a runtime exists and that a future Tokio slice may add scheduled sweeps. Because contributors and agents are required to follow this document, leaving both models documented makes the implemented lifecycle policy ambiguous; update the older section as part of this runtime change.
**<sub><sub></sub></sub> Update the obsolete packet-driven expiry guidance**
This new runtime-maintenance rule contradicts the later section of the same scoped guidance, which still says expiry is packet-driven until a runtime exists and that a future Tokio slice may add scheduled sweeps. Because contributors and agents are required to follow this document, leaving both models documented makes the implemented lifecycle policy ambiguous; update the older section as part of this runtime change.
AGENTS.md reference: [crates/irtt-server/AGENTS.md:L205-L213](https://github.com/Lochnair/irtt-rs/blob/85c432fcf87f22bdf0b0b25cc9038edb927b28e5/crates/irtt-server/AGENTS.md#L205-L213)
Useful? React with 👍 / 👎.
When outbound UDP backpressure makes send_to return Pending, this inner .await stops polling the outer select!, including the shutdown future and maintenance timer. A shutdown request can therefore hang indefinitely, and idle sessions are not reclaimed until the socket becomes writable; select the cancellation signal alongside the send or otherwise bound/cancel the send wait.
**<sub><sub></sub></sub> Poll shutdown while send_to is pending**
When outbound UDP backpressure makes `send_to` return `Pending`, this inner `.await` stops polling the outer `select!`, including the shutdown future and maintenance timer. A shutdown request can therefore hang indefinitely, and idle sessions are not reclaimed until the socket becomes writable; select the cancellation signal alongside the send or otherwise bound/cancel the send wait.
AGENTS.md reference: [AGENTS.md:L77-L77](https://github.com/Lochnair/irtt-rs/blob/85c432fcf87f22bdf0b0b25cc9038edb927b28e5/AGENTS.md#L77-L77)
Useful? React with 👍 / 👎.
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
### 💡 Codex Review
Here are some automated review suggestions for this pull request.
**Reviewed commit:** `41e39bd5b9`
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
</details>
This new current-scope statement says Tokio UDP orchestration is implemented, but the repository-wide architecture guidance still says the Tokio runtime is unimplemented and expiry remains packet-driven. Contributors following that required guidance will receive an obsolete lifecycle model, so update the root status alongside these crate-level docs. Fresh evidence beyond the earlier scoped-guidance comment is that the scoped file is now corrected while the root guidance remains stale.
**<sub><sub></sub></sub> Update the repository-wide runtime status**
This new current-scope statement says Tokio UDP orchestration is implemented, but the repository-wide architecture guidance still says the Tokio runtime is unimplemented and expiry remains packet-driven. Contributors following that required guidance will receive an obsolete lifecycle model, so update the root status alongside these crate-level docs. Fresh evidence beyond the earlier scoped-guidance comment is that the scoped file is now corrected while the root guidance remains stale.
AGENTS.md reference: [AGENTS.md:L60-L60](https://github.com/Lochnair/irtt-rs/blob/41e39bd5b95da2296283fd6b5954ebd0469846eb/AGENTS.md#L60-L60)
Useful? React with 👍 / 👎.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Serverthat binds one UDP listener around oneServerCore.irtt-client::AsyncClient.Runtime model
Server::run; send failures drop only that reply.Clean-room / scope
ServerFillpolicy is included.Verification
cargo fmt --all -- --checkCARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo check --workspace --all-targets --all-features --lockedCARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo test --workspace --all-targets --all-features --lockedCARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo clippy --workspace --all-targets --all-features --locked -- -D warningsRUSTDOCFLAGS="-D warnings" CARGO_TARGET_DIR=/private/tmp/irtt-rs-server-runtime-target cargo doc -p irtt-proto -p irtt-client -p irtt-server --all-features --no-depscargo tree -p irtt-server --edges normalgit diff --check main...HEAD💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
85c432fcf8ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@@ -46,0 +52,4 @@send failure (including a short send) drops only that reply and must not stopthe listener. Core state is not rolled back after a transport send failure.- Runtime maintenance calls the core's expiry hook. It must not inspect sessioninternals or grow a second expiry rule.This new runtime-maintenance rule contradicts the later section of the same scoped guidance, which still says expiry is packet-driven until a runtime exists and that a future Tokio slice may add scheduled sweeps. Because contributors and agents are required to follow this document, leaving both models documented makes the implemented lifecycle policy ambiguous; update the older section as part of this runtime change.
AGENTS.md reference: crates/irtt-server/AGENTS.md:L205-L213
Useful? React with 👍 / 👎.
@@ -0,0 +1,287 @@//! Tokio UDP orchestration around [`ServerCore`](crate::ServerCore).When outbound UDP backpressure makes
send_toreturnPending, this inner.awaitstops polling the outerselect!, including the shutdown future and maintenance timer. A shutdown request can therefore hang indefinitely, and idle sessions are not reclaimed until the socket becomes writable; select the cancellation signal alongside the send or otherwise bound/cancel the send wait.AGENTS.md reference: AGENTS.md:L77-L77
Useful? React with 👍 / 👎.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
41e39bd5b9ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@@ -63,3 +65,4 @@ pub use config::{};This new current-scope statement says Tokio UDP orchestration is implemented, but the repository-wide architecture guidance still says the Tokio runtime is unimplemented and expiry remains packet-driven. Contributors following that required guidance will receive an obsolete lifecycle model, so update the root status alongside these crate-level docs. Fresh evidence beyond the earlier scoped-guidance comment is that the scoped file is now corrected while the root guidance remains stale.
AGENTS.md reference: AGENTS.md:L60-L60
Useful? React with 👍 / 👎.