std::net::TcpListener
Struct std::net::TcpListener
pub struct TcpListener(_);
A TCP socket server, listening for connections.
After creating a TcpListener
by bind
ing it to a socket address, it listens for incoming TCP connections. These can be accepted by calling accept
or by iterating over the Incoming
iterator returned by incoming
.
The socket will be closed when the value is dropped.
The Transmission Control Protocol is specified in IETF RFC 793.
Examples
use std::net::{TcpListener, TcpStream}; let listener = TcpListener::bind("127.