rust-libp2p/tcp-transport
Pierre Krieger 486a9694d9
Tcp refinements (#404)
* Improve nat_traversal

* Remove the Box for dialing

* Improve multiaddr_to_socketaddr

* Use ? on None

* Use a proper stream for TcpListenStream

* Rustfmt

* Use tk_listen for errors on the listener

* Minor changes

* Fix concerns
2018-08-09 14:04:15 +02:00
..
2018-08-09 14:04:15 +02:00
2018-07-16 12:15:27 +02:00

TCP transport

Implementation of the libp2p Transport trait for TCP/IP.

Uses the tokio library.

Usage

Example:

extern crate libp2p_tcp_transport;
extern crate tokio_current_thread;

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

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

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.