feat(client): implement multi-target ManagedClientGroup for shared-socket probing

Introduce a managed group runner to support concurrent probing of multiple targets over a single UDP socket with coordinated send pacing. Refactor the existing client logic into a reusable SessionRuntime to support both individual and grouped session management.
This commit is contained in:
Nils Andreas Svee committed 2026-06-23 21:02:54 +07:00
1 parent ac82537043
commit acffc3cd4e
10 files changed
+3127 -818

No files matched your search

+32
View File
@@ -15,6 +15,14 @@ pub(crate) struct ReceivedDatagram {
pub(crate) meta: ReceiveMeta,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) struct ReceivedDatagramFrom {
pub(crate) len: usize,
pub(crate) source: SocketAddr,
pub(crate) received_at: ClientTimestamp,
pub(crate) meta: ReceiveMeta,
}
#[cfg(not(all(target_os = "linux", feature = "ancillary")))]
pub(crate) fn recv_datagram(
socket: &UdpSocket,
@@ -30,6 +38,22 @@ pub(crate) fn recv_datagram(
})
}
#[cfg(not(all(target_os = "linux", feature = "ancillary")))]
pub(crate) fn recv_datagram_from(
socket: &UdpSocket,
buf: &mut [u8],
) -> Result<ReceivedDatagramFrom, io::Error> {
let (len, source) = socket.recv_from(buf)?;
let received_at = ClientTimestamp::now();
Ok(ReceivedDatagramFrom {
len,
source,
received_at,
meta: ReceiveMeta::default(),
})
}
#[cfg(all(target_os = "linux", feature = "ancillary"))]
pub(crate) fn recv_datagram(
socket: &UdpSocket,
@@ -38,6 +62,14 @@ pub(crate) fn recv_datagram(
linux::recv_datagram(socket, buf)
}
#[cfg(all(target_os = "linux", feature = "ancillary"))]
pub(crate) fn recv_datagram_from(
socket: &UdpSocket,
buf: &mut [u8],
) -> Result<ReceivedDatagramFrom, io::Error> {
linux::recv_datagram_from(socket, buf)
}
#[cfg(not(all(target_os = "linux", feature = "ancillary")))]
pub(crate) fn configure_receive_metadata(
_socket: &UdpSocket,