mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
udp: add network.only_ipv6 config flag
This commit is contained in:
parent
4641dd29f2
commit
4b07e007f3
3 changed files with 6 additions and 2 deletions
2
TODO.md
2
TODO.md
|
|
@ -20,12 +20,10 @@
|
|||
* uring
|
||||
* ValidUntil periodic update
|
||||
* statistics
|
||||
* ipv6_only
|
||||
* shared config keys such as poll interval
|
||||
* mio
|
||||
* stagger connection cleaning intervals?
|
||||
* ipv4-mapped addresses
|
||||
* ipv6_only
|
||||
* glommio
|
||||
* consider sending local responses immediately
|
||||
* consider adding ConnectedScrapeRequest::Scrape(PendingScrapeRequest)
|
||||
|
|
|
|||
|
|
@ -123,6 +123,10 @@ pub fn create_socket(config: &Config) -> ::std::net::UdpSocket {
|
|||
}
|
||||
.expect("create socket");
|
||||
|
||||
if config.network.only_ipv6 {
|
||||
socket.set_only_v6(true).expect("socket: set only ipv6");
|
||||
}
|
||||
|
||||
socket.set_reuse_port(true).expect("socket: set reuse port");
|
||||
|
||||
socket
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ impl aquatic_cli_helpers::Config for Config {
|
|||
pub struct NetworkConfig {
|
||||
/// Bind to this address
|
||||
pub address: SocketAddr,
|
||||
pub only_ipv6: bool,
|
||||
/// Size of socket recv buffer. Use 0 for OS default.
|
||||
///
|
||||
/// This setting can have a big impact on dropped packages. It might
|
||||
|
|
@ -120,6 +121,7 @@ impl Default for NetworkConfig {
|
|||
fn default() -> Self {
|
||||
Self {
|
||||
address: SocketAddr::from(([0, 0, 0, 0], 3000)),
|
||||
only_ipv6: false,
|
||||
socket_recv_buffer_size: 4096 * 128,
|
||||
#[cfg(feature = "with-mio")]
|
||||
poll_event_capacity: 4096,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue