rust-libp2p/libp2p-tcp-transport
Jef 5217e29fab
Add rustfmt to travis (#137)
* RFC styling-based `rustfmt.toml`

* Add rustfmt to travis

* Remove rustfmt.toml and actually fix too-long lines instead of ignoring them
2018-03-07 16:20:55 +01:00
..
2018-03-07 16:20:55 +01:00
2017-11-20 17:03:50 +01:00

TCP transport

Implementation of the libp2p Transport trait for TCP/IP.

Uses the tokio library.

Usage

Create a tokio Core, then grab a handle by calling the handle() method on it, then create a TcpConfig and pass the handle.

Example:

extern crate libp2p_tcp_transport;
extern crate tokio_core;

use libp2p_tcp_transport::TcpConfig;
use tokio_core::reactor::Core;

let mut core = Core::new().unwrap();
let tcp = TcpConfig::new(core.handle());

The TcpConfig structs implements the Transport trait of the swarm library. See the documentation of swarm and of libp2p in general to learn how to use the Transport trait.