refactor(managed): remove legacy runtime

This commit is contained in:
Nils Andreas Svee committed 2026-08-09 20:58:36 +07:00
1 parent 1a9e8f28aa
commit c599c84715
18 files changed
+36 -7847

No files matched your search

-38
View File
@@ -164,44 +164,6 @@ pub(crate) fn connect_tokio_udp_socket(
Ok(tokio::net::UdpSocket::from_std(socket)?)
}
pub(crate) fn bind_unconnected_udp_socket(
config: &SocketConfig,
family_remote: SocketAddr,
) -> Result<UdpSocket, ClientError> {
let domain = if family_remote.is_ipv4() {
Domain::IPV4
} else {
Domain::IPV6
};
let socket = Socket::new(domain, Type::DGRAM, Some(Protocol::UDP))?;
if config.ipv6_only && family_remote.is_ipv6() {
socket.set_only_v6(true)?;
}
let bind_addr = config.bind_addr.unwrap_or_else(|| {
if family_remote.is_ipv4() {
SocketAddr::from(([0, 0, 0, 0], 0))
} else {
SocketAddr::from(([0_u16; 8], 0))
}
});
socket.bind(&bind_addr.into())?;
let socket: UdpSocket = socket.into();
configure_receive_metadata(&socket, family_remote).map_err(|source| {
ClientError::SocketOption {
operation: "enable receive metadata",
remote: family_remote,
source,
}
})?;
if let Some(ttl) = config.ttl {
apply_ttl_to_socket(&socket, family_remote, ttl)?;
}
socket.set_read_timeout(config.recv_timeout)?;
Ok(socket)
}
#[cfg(test)]
mod tests {
use super::*;