mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-26 00:01:33 +00:00
Update socket2 requirement from 0.3.19 to 0.4.0 (#1997)
* Update socket2 requirement from 0.3.19 to 0.4.0 Updates the requirements on [socket2](https://github.com/rust-lang/socket2) to permit the latest version. - [Release notes](https://github.com/rust-lang/socket2/releases) - [Changelog](https://github.com/rust-lang/socket2/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/socket2/compare/v0.3.19...v0.3.19) Signed-off-by: dependabot[bot] <support@github.com> * Adapt to API and feature changes. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roman S. Borschel <roman@parity.io>
This commit is contained in:
@ -122,15 +122,15 @@ impl Mdns {
|
||||
pub async fn new(config: MdnsConfig) -> io::Result<Self> {
|
||||
let recv_socket = {
|
||||
let socket = Socket::new(
|
||||
Domain::ipv4(),
|
||||
Type::dgram(),
|
||||
Some(socket2::Protocol::udp()),
|
||||
Domain::IPV4,
|
||||
Type::DGRAM,
|
||||
Some(socket2::Protocol::UDP),
|
||||
)?;
|
||||
socket.set_reuse_address(true)?;
|
||||
#[cfg(unix)]
|
||||
socket.set_reuse_port(true)?;
|
||||
socket.bind(&SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), 5353).into())?;
|
||||
let socket = socket.into_udp_socket();
|
||||
let socket = UdpSocket::from(socket);
|
||||
socket.set_multicast_loop_v4(true)?;
|
||||
socket.set_multicast_ttl_v4(255)?;
|
||||
Async::new(socket)?
|
||||
|
Reference in New Issue
Block a user