mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-21 22:01:34 +00:00
Update tokio requirement from 0.2 to 0.3 (#1796)
* Update tokio requirement from 0.2 to 0.3 Updates the requirements on [tokio](https://github.com/tokio-rs/tokio) to permit the latest version. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-0.2.0...tokio-0.3.0) Signed-off-by: dependabot[bot] <support@github.com> * protocols/mdns: Ensure to set non_blocking on tokio udp socket * transports/tcp: Ensure to set non_blocking on tokio tcp socket See https://github.com/tokio-rs/tokio/pull/3016 for details. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -298,8 +298,9 @@ impl fmt::Debug for $service_name {
|
||||
#[cfg(feature = "async-std")]
|
||||
codegen!("async-std", MdnsService, async_std::net::UdpSocket, (|socket| Ok::<_, std::io::Error>(async_std::net::UdpSocket::from(socket))));
|
||||
|
||||
// Note: Tokio's UdpSocket::from_std does not set the socket into non-blocking mode.
|
||||
#[cfg(feature = "tokio")]
|
||||
codegen!("tokio", TokioMdnsService, tokio::net::UdpSocket, (|socket| tokio::net::UdpSocket::from_std(socket)));
|
||||
codegen!("tokio", TokioMdnsService, tokio::net::UdpSocket, (|socket: std::net::UdpSocket| { socket.set_nonblocking(true); tokio::net::UdpSocket::from_std(socket) }));
|
||||
|
||||
|
||||
/// A valid mDNS packet received by the service.
|
||||
|
Reference in New Issue
Block a user