Files
fips/src/peer/connected_udp/mod.rs
T
Johnathan Corgan 89a31fd555 transport: move the connected-UDP fast-path handles into the peer module
ConnectedPeerSocket and PeerRecvDrain are node/peer-side logic: the Transport
trait never touches them, ActivePeer stores them, and node's encrypt worker
drives them. They only happened to live under transport/udp. Relocate the
handle types to a new src/peer/connected_udp/ module (socket.rs + drain.rs),
which the node handler and encrypt worker reach via node -> peer (no new edge;
a node home would have forced a peer -> node cycle).

The udp transport keeps only the kernel-construction seam: open_connected_fd,
now folded into udp/io.rs (the byte-layer home) behind a linux/macos-gated
submodule and re-exported as transport::udp::open_connected_fd. The node
handler builds the fd through it and adopts it via ConnectedPeerSocket::from_fd.

Behavior-neutral: no wire/config/metric/log change; the per-packet hot path
(bare-RawFd send_batch_gso/raw) is untouched. Preserves the Arc multi-owner
contract, the drop-drain-before-socket ordering, and the drain's detach-on-Drop
deadlock avoidance. Reconciles the old cfg(unix)/any(linux,macos) double-gate
onto the single any(linux,macos) predicate.
2026-07-11 21:30:36 +00:00

17 lines
650 B
Rust

//! Per-peer connected-UDP fast-path handles.
//!
//! The connected-socket rationale and the fd-construction syscall
//! sequence live in `crate::transport::udp::open_connected_fd`. This
//! module owns the runtime handle types that adopt the resulting fd:
//!
//! - [`socket::ConnectedPeerSocket`] — the owning fd wrapper.
//! - [`drain::PeerRecvDrain`] — the recv-side drain thread that must
//! accompany every connected socket (the kernel routes the peer's
//! inbound packets to it, so it has to be drained).
pub(crate) mod drain;
pub(crate) mod socket;
pub(crate) use drain::PeerRecvDrain;
pub(crate) use socket::ConnectedPeerSocket;