Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libp2p-swarm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern crate tokio_core;
use libp2p_swarm::Transport;

let tokio_core = tokio_core::reactor::Core::new().unwrap();
let tcp_transport = libp2p_tcp_transport::Tcp::new(tokio_core.handle()).unwrap();
let tcp_transport = libp2p_tcp_transport::TcpConfig::new(tokio_core.handle());
let upgraded = tcp_transport.with_upgrade(libp2p_swarm::PlainText);

// upgraded.dial(...) // automatically applies the plain text protocol on the socket
Expand Down Expand Up @@ -83,8 +83,8 @@ use libp2p_swarm::Transport;

let mut core = tokio_core::reactor::Core::new().unwrap();

let ping_finished_future = libp2p_tcp_transport::Tcp::new(core.handle()).unwrap()
// We have a `Tcp` struct that implements `Transport`, and apply a `Ping` upgrade on it.
let ping_finished_future = libp2p_tcp_transport::TcpConfig::new(core.handle())
// We have a `TcpConfig` struct that implements `Transport`, and apply a `Ping` upgrade on it.
.with_upgrade(Ping)
// TODO: right now the only available protocol is ping, but we want to replace it with
// something that is more simple to use
Expand Down
6 changes: 3 additions & 3 deletions libp2p-swarm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
//!
//! # fn main() {
//! let tokio_core = tokio_core::reactor::Core::new().unwrap();
//! let tcp_transport = libp2p_tcp_transport::Tcp::new(tokio_core.handle()).unwrap();
//! let tcp_transport = libp2p_tcp_transport::TcpConfig::new(tokio_core.handle());
//! let upgraded = tcp_transport.with_upgrade(libp2p_swarm::PlainText);
//!
//! // upgraded.dial(...) // automatically applies the plain text protocol on the socket
Expand Down Expand Up @@ -109,8 +109,8 @@
//! # fn main() {
//! let mut core = tokio_core::reactor::Core::new().unwrap();
//!
//! let ping_finished_future = libp2p_tcp_transport::Tcp::new(core.handle()).unwrap()
//! // We have a `Tcp` struct that implements `Transport`, and apply a `Ping` upgrade on it.
//! let ping_finished_future = libp2p_tcp_transport::TcpConfig::new(core.handle())
//! // We have a `TcpConfig` struct that implements `Transport`, and apply a `Ping` upgrade on it.
//! .with_upgrade(Ping)
//! // TODO: right now the only available protocol is ping, but we want to replace it with
//! // something that is more simple to use
Expand Down