1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Cross-platform, batch-native UDP I/O with platform-optimal syscalls.
//!
//! `binger-udp` gives you a clean batch API for sending and receiving UDP
//! datagrams, automatically selecting the most efficient system call available
//! on the current platform:
//!
//! | Platform | Send | Recv |
//! |----------|------|------|
//! | Linux | `sendmmsg` / `sendmsg` w/ GSO | `recvmmsg` |
//! | macOS | `sendmsg_x` (via `dlsym`) | `recvmsg_x` (via `dlsym`) |
//! | Windows | `WSASendMsg` | `WSARecvMsg` (via `WSAIoctl`) |
//! | Any | `sendto` / `recvfrom` fallback | `recvfrom` fallback |
//!
//! # Quick start
//!
//! ```rust,no_run
//! use std::error::Error;
//! use binger_udp::{BingerUdp, SendBatch, RecvBatch, Config};
//!
//! # async fn example() -> Result<(), Box<dyn Error>> {
//! let socket = BingerUdp::from_std(
//! std::net::UdpSocket::bind("0.0.0.0:0")?,
//! Config::default(),
//! )?;
//!
//! // Batch-send 32 packets in one syscall
//! let mut send = SendBatch::<32>::new();
//! send.push(b"hello", "192.168.1.1:8080".parse().unwrap())?;
//! let sent = socket.send_batch(&mut send).await?;
//!
//! // Batch-receive up to 32 packets in one syscall
//! let mut recv = RecvBatch::<32>::new(2048);
//! let n = socket.recv_batch(&mut recv).await?;
//! # Ok(()) }
//! ```
pub use Timestamp;
pub use ;
pub use BufferPool;
pub use BingerError;
pub use BingerMetrics;
pub use ;