Type Alias libp2p_tcp::async_io::Transport

source ·
pub type Transport = Transport<Tcp>;
Available on crate feature async-io only.
Expand description

A TCP Transport that works with the async-std ecosystem.

§Example

let mut transport = tcp::async_io::Transport::new(tcp::Config::default());
let id = ListenerId::next();
transport.listen_on(id, "/ip4/127.0.0.1/tcp/0".parse().unwrap()).unwrap();

let addr = future::poll_fn(|cx| Pin::new(&mut transport).poll(cx)).await.into_new_address().unwrap();

println!("Listening on {addr}");

Aliased Type§

struct Transport { /* private fields */ }