udp_socket/
lib.rs

1#[cfg(unix)]
2mod cmsg;
3mod proto;
4mod socket;
5#[cfg(unix)]
6mod unix;
7
8pub use proto::{EcnCodepoint, RecvMeta, SocketType, Transmit, UdpCapabilities};
9pub use socket::UdpSocket;
10
11/// Number of UDP packets to send/receive at a time when using sendmmsg/recvmmsg.
12pub const BATCH_SIZE: usize = {
13    if cfg!(target_os = "linux") {
14        // Chosen somewhat arbitrarily; might benefit from additional tuning.
15        32
16    } else {
17        1
18    }
19};