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
use std::net::Ipv4Addr;
use std::time::Duration;
#[cfg(windows)]
mod win;
#[cfg(windows)]
pub use win::*;
#[cfg(not(windows))]
mod unix;
#[cfg(not(windows))]
pub use unix::*;
pub struct MulticastOptions {
pub read_timeout: Duration,
pub loopback: bool,
pub buffer_size: usize,
pub bind_address: Ipv4Addr,
}
impl Default for MulticastOptions {
fn default() -> Self {
MulticastOptions {
read_timeout: Duration::from_secs(1),
loopback: true,
buffer_size: 512,
bind_address: Ipv4Addr::UNSPECIFIED,
}
}
}