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:
dependabot[bot]
2021-03-15 17:33:49 +01:00
committed by GitHub
parent 375690d396
commit 9dbc90efe7
4 changed files with 11 additions and 11 deletions

View File

@ -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)?