mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-31 00:41:59 +00:00
Don't poll network unnecessarily. (#1977)
* Don't poll network unnecessarily. * Fix ci. * Damn tokio. * Address review comments. * Update deps. * Don't drop packet if socket is not writable. * Increase TTL and rename to `query_interval`. * Update CHANGELOG. Co-authored-by: Roman S. Borschel <roman@parity.io>
This commit is contained in:
@@ -58,7 +58,7 @@ use libp2p::{
|
||||
NetworkBehaviour,
|
||||
identity,
|
||||
floodsub::{self, Floodsub, FloodsubEvent},
|
||||
mdns::{Mdns, MdnsEvent},
|
||||
mdns::{Mdns, MdnsConfig, MdnsEvent},
|
||||
swarm::NetworkBehaviourEventProcess
|
||||
};
|
||||
use std::{error::Error, task::{Context, Poll}};
|
||||
@@ -121,7 +121,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
// Create a Swarm to manage peers and events
|
||||
let mut swarm = {
|
||||
let mdns = task::block_on(Mdns::new())?;
|
||||
let mdns = task::block_on(Mdns::new(MdnsConfig::default()))?;
|
||||
let mut behaviour = MyBehaviour {
|
||||
floodsub: Floodsub::new(local_peer_id.clone()),
|
||||
mdns,
|
||||
|
Reference in New Issue
Block a user