File tree Expand file tree Collapse file tree 2 files changed +174
-26
lines changed Expand file tree Collapse file tree 2 files changed +174
-26
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,17 @@ mod imp;
16
16
pub use imp:: { sync, UdpSocket } ;
17
17
pub mod framed;
18
18
19
- /// Number of UDP packets to send/receive at a time
20
- pub const BATCH_SIZE : usize = imp:: BATCH_SIZE ;
19
+ /// Maximum number of UDP packets that can be sent by the `sendmmsg`/`recvmmsg`
20
+ /// wrappers. Note that, for supported platforms, the OS caps the batch size at
21
+ /// this value, but will not return an error, so this is just a suggested
22
+ /// maximum.
23
+ ///
24
+ /// Presently, this is 1024 on Linux an FreeBS, and 1 on platforms that don't
25
+ /// support `sendmmsg`/`recvmmsg`
26
+ pub const BATCH_SIZE_CAP : usize = imp:: BATCH_SIZE_CAP ;
27
+
28
+ /// Default number of UDP packets to send/receive at a time.
29
+ pub const DEFAULT_BATCH_SIZE : usize = imp:: DEFAULT_BATCH_SIZE ;
21
30
22
31
/// The capabilities a UDP socket suppports on a certain platform
23
32
#[ derive( Debug ) ]
You can’t perform that action at this time.
0 commit comments