transport: rename udp byte-layer module from socket to io

Normalizes the udp transport onto the canonical per-transport module
layout (ble is the reference: io/pool/addr/stats). Pure file rename plus
module-path updates at the use sites; no logic, wire, config, metric, or
log change. Behavior identical.
This commit is contained in:
Johnathan Corgan
2026-07-11 20:10:19 +00:00
parent 32475d859e
commit 0f2e91b479
3 changed files with 8 additions and 8 deletions
+5 -5
View File
@@ -52,7 +52,7 @@
use crate::proto::fmp::wire::ESTABLISHED_HEADER_SIZE; use crate::proto::fmp::wire::ESTABLISHED_HEADER_SIZE;
use crate::proto::fsp::wire::FSP_HEADER_SIZE; use crate::proto::fsp::wire::FSP_HEADER_SIZE;
use crate::transport::udp::socket::AsyncUdpSocket; use crate::transport::udp::io::AsyncUdpSocket;
#[cfg(not(target_os = "macos"))] #[cfg(not(target_os = "macos"))]
use crossbeam_channel::{Receiver, SendError, Sender, TrySendError, bounded}; use crossbeam_channel::{Receiver, SendError, Sender, TrySendError, bounded};
use ring::aead::{Aad, LessSafeKey, Nonce}; use ring::aead::{Aad, LessSafeKey, Nonce};
@@ -1710,7 +1710,7 @@ fn send_batch_gso(
} }
/// Direct `sendmmsg(2)` wrapper for the sync worker. The /// Direct `sendmmsg(2)` wrapper for the sync worker. The
/// `transport::udp::socket` module's existing `send_batch` is /// `transport::udp::io` module's existing `send_batch` is
/// pub(crate) on `UdpRawSocket`, but we don't have a handle to the /// pub(crate) on `UdpRawSocket`, but we don't have a handle to the
/// raw socket from here — we just have the FD. Re-implementing /// raw socket from here — we just have the FD. Re-implementing
/// inline is ~15 lines and avoids tunnelling the inner socket /// inline is ~15 lines and avoids tunnelling the inner socket
@@ -1780,7 +1780,7 @@ fn send_batch_raw(
#[cfg(all(test, unix))] #[cfg(all(test, unix))]
mod unix_tests { mod unix_tests {
use super::*; use super::*;
use crate::transport::udp::socket::UdpRawSocket; use crate::transport::udp::io::UdpRawSocket;
use ring::aead::{LessSafeKey, UnboundKey}; use ring::aead::{LessSafeKey, UnboundKey};
use std::net::UdpSocket; use std::net::UdpSocket;
@@ -2220,7 +2220,7 @@ mod tests {
/// AsRawFd impl. /// AsRawFd impl.
#[test] #[test]
fn flush_batch_routes_each_target_separately() { fn flush_batch_routes_each_target_separately() {
use crate::transport::udp::socket::UdpRawSocket; use crate::transport::udp::io::UdpRawSocket;
use ring::aead::{LessSafeKey, UnboundKey}; use ring::aead::{LessSafeKey, UnboundKey};
use std::net::UdpSocket; use std::net::UdpSocket;
@@ -2266,7 +2266,7 @@ mod tests {
const B_WIRE: usize = 16 + B_PLAINTEXT + 16; // 96 const B_WIRE: usize = 16 + B_PLAINTEXT + 16; // 96
fn make_job( fn make_job(
socket: crate::transport::udp::socket::AsyncUdpSocket, socket: crate::transport::udp::io::AsyncUdpSocket,
cipher: &LessSafeKey, cipher: &LessSafeKey,
counter: u64, counter: u64,
dest: SocketAddr, dest: SocketAddr,
@@ -844,7 +844,7 @@ mod tests {
/// drained over a fixed wall-clock window per mode. /// drained over a fixed wall-clock window per mode.
/// ///
/// Run with: /// Run with:
/// cargo test --release -p fips --lib transport::udp::socket::tests::bench_udp_recv_amortization -- --ignored --nocapture /// cargo test --release -p fips --lib transport::udp::io::tests::bench_udp_recv_amortization -- --ignored --nocapture
/// ///
/// Sender runs on a dedicated *blocking* OS thread (std::net::UdpSocket /// Sender runs on a dedicated *blocking* OS thread (std::net::UdpSocket
/// in default blocking mode) so it always saturates the kernel rx queue /// in default blocking mode) so it always saturates the kernel rx queue
+2 -2
View File
@@ -10,14 +10,14 @@ use super::{
pub(crate) mod connected_peer; pub(crate) mod connected_peer;
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub(crate) mod darwin_sockopts; pub(crate) mod darwin_sockopts;
pub(crate) mod io;
#[cfg(unix)] #[cfg(unix)]
pub(crate) mod peer_drain; pub(crate) mod peer_drain;
pub(crate) mod socket;
mod stats; mod stats;
use super::resolve_socket_addr; use super::resolve_socket_addr;
use crate::config::UdpConfig; use crate::config::UdpConfig;
use crate::nostr::is_punch_packet; use crate::nostr::is_punch_packet;
use socket::{AsyncUdpSocket, UdpRawSocket}; use io::{AsyncUdpSocket, UdpRawSocket};
use stats::UdpStats; use stats::UdpStats;
use std::collections::HashMap; use std::collections::HashMap;
use std::net::SocketAddr; use std::net::SocketAddr;