Each published crate (irtt-rs, irtt-client, irtt-server, irtt-stats, irtt-proto) now points crates.io at its own README instead of inheriting the root project README via the workspace-wide readme default, which is removed. Each crate README is a short landing page: what the crate is, who should use it, which sibling crate to use instead if this isn't the right abstraction level, and links to docs.rs and the main repository. Add real Cargo example targets teaching irtt-client's blocking/Tokio/ managed API tiers, a basic and a multi-listener irtt-server example, and an irtt-stats example contrasting finite vs continuous retention. irtt-proto intentionally has none. Update each crate's top-level rustdoc to explain its API-tier choices and point at the examples, and enable docs.rs rustdoc example scraping for irtt-client and irtt-server (via doc-scrape-examples on each example target, needed because the crate has dev-dependencies). The client examples are caller-paced against next_send_deadline() rather than sending on every loop iteration, bound their receive wait by the next send/timeout deadline instead of awaiting indefinitely, poll timeouts on a short fixed cadence, and surface send/receive/close errors instead of discarding them via unwrap_or_default()/if-let-Ok -- so they demonstrate correct pacing and terminate/report cleanly rather than racing the server, hanging on a lost reply, or silently dropping a failed final close.
36 lines
1.2 KiB
TOML
36 lines
1.2 KiB
TOML
[package]
|
|
name = "irtt-server"
|
|
version = "0.5.0"
|
|
description = "IRTT-compatible Rust server library"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
repository.workspace = true
|
|
homepage.workspace = true
|
|
readme = "README.md"
|
|
keywords = ["irtt", "networking", "latency", "server"]
|
|
categories = ["network-programming"]
|
|
|
|
[dependencies]
|
|
irtt-proto.workspace = true
|
|
getrandom = "0.4.3"
|
|
socket2 = { version = "0.6.5", features = ["all"] }
|
|
thiserror = "2.0.20"
|
|
tokio = { version = "1.53.1", default-features = false, features = ["rt", "net", "time", "sync", "macros"] }
|
|
|
|
# Wildcard listeners recover each request's local destination address and send
|
|
# the reply from it. Only these targets have a safe destination-metadata and
|
|
# source-selection path here; elsewhere a wildcard bind is refused.
|
|
[target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))'.dependencies]
|
|
nix = { version = "0.31.3", default-features = false, features = ["net", "uio"] }
|
|
|
|
[package.metadata.docs.rs]
|
|
all-features = true
|
|
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
|
|
|
|
[[example]]
|
|
name = "basic_server"
|
|
|
|
[[example]]
|
|
name = "multi_listener"
|