Skip to content

Commit c2e4e81

Browse files
authored
Merge pull request #16 from chertov/feature-reuse-port
Add reuse_port cargo feature
2 parents c40405b + 0a47323 commit c2e4e81

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

crates/mdns/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ repository = "https://github.com/webrtc-rs/mdns"
1111

1212
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1313

14+
[features]
15+
default = [ "reuse_port" ]
16+
reuse_port = []
17+
1418
[dependencies]
1519
util = { package = "webrtc-util", version = "0.1.18" }
1620
lazy_static = "1.3.0"

crates/mdns/src/conn/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ impl DnsConn {
5656
Some(socket2::Protocol::UDP),
5757
)?;
5858

59+
#[cfg(feature = "reuse_port")]
5960
#[cfg(target_family = "unix")]
6061
socket.set_reuse_port(true)?;
6162

0 commit comments

Comments
 (0)