2018-03-15 03:38:59 +11:00
|
|
|
//! TCP bindings for `tokio`.
|
|
|
|
|
//!
|
|
|
|
|
//! This module contains the TCP networking types, similar to the standard
|
|
|
|
|
//! library, which can be used to implement networking protocols.
|
|
|
|
|
//!
|
|
|
|
|
//! Connecting to an address, via TCP, can be done using [`TcpStream`]'s
|
2019-06-24 12:34:30 -07:00
|
|
|
//! [`connect`] method, which returns a future which returns a `TcpStream`.
|
2018-03-15 03:38:59 +11:00
|
|
|
//!
|
|
|
|
|
//! To listen on an address [`TcpListener`] can be used. `TcpListener`'s
|
|
|
|
|
//! [`incoming`][incoming_method] method can be used to accept new connections.
|
|
|
|
|
//! It return the [`Incoming`] struct, which implements a stream which returns
|
|
|
|
|
//! `TcpStream`s.
|
|
|
|
|
//!
|
|
|
|
|
//! [`TcpStream`]: struct.TcpStream.html
|
|
|
|
|
//! [`connect`]: struct.TcpStream.html#method.connect
|
|
|
|
|
//! [`TcpListener`]: struct.TcpListener.html
|
|
|
|
|
//! [incoming_method]: struct.TcpListener.html#method.incoming
|
|
|
|
|
//! [`Incoming`]: struct.Incoming.html
|
|
|
|
|
|
2019-07-15 17:02:15 -04:00
|
|
|
#[cfg(feature = "async-traits")]
|
2018-03-15 03:38:59 +11:00
|
|
|
mod incoming;
|
|
|
|
|
mod listener;
|
2019-06-29 14:36:49 +08:00
|
|
|
pub mod split;
|
2018-03-15 03:38:59 +11:00
|
|
|
mod stream;
|
|
|
|
|
|
2019-10-02 20:12:05 +02:00
|
|
|
#[cfg(feature = "async-traits")]
|
|
|
|
|
pub use self::incoming::Incoming;
|
2018-03-15 03:38:59 +11:00
|
|
|
pub use self::listener::TcpListener;
|
2019-02-21 11:56:15 -08:00
|
|
|
pub use self::stream::TcpStream;
|