Expand description
TCP bindings for tokio.
Note: This crate is deprecated in tokio 0.2.x and has been moved into
tokio::tcpbehind thetcpfeature flag.
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
connect method, which returns ConnectFuture. ConnectFuture
implements a future which returns a TcpStream.
To listen on an address TcpListener can be used. TcpListener’s
incoming method can be used to accept new connections.
It return the Incoming struct, which implements a stream which returns
TcpStreams.
Structs§
- Connect
Future - Future returned by
TcpStream::connectwhich will resolve to aTcpStreamwhen the stream is connected. - Incoming
- Stream returned by the
TcpListener::incomingfunction representing the stream of sockets received from a listener. - TcpListener
- An I/O object representing a TCP socket listening for incoming connections.
- TcpStream
- An I/O object representing a TCP stream connected to a remote endpoint.