[−][src]Struct cancellable_io::TcpListener
A TCP socket server, listening for connections.
The socket will be closed when the value is dropped.
The accept and the incoming methods can be interrupted using the Canceller object created with the socket.
Otherwise similar to std::net::TcpListener.
Methods
impl TcpListener
[src]
pub fn bind<A: ToSocketAddrs>(address: A) -> Result<(Self, Canceller)>
[src]
Creates a new TcpListener which will be bound to the specified address, together with an object that allows cancelling accept operations.
pub fn local_addr(&self) -> Result<SocketAddr>
[src]
Returns the local socket address of this listener.
pub fn try_clone(&self) -> Result<(Self, Canceller)>
[src]
Creates a new independently owned handle to the underlying socket.
pub fn accept(&self) -> Result<(TcpStream, Canceller, SocketAddr)>
[src]
Accepts a new incoming connection from this listener.
This method can be cancelled by the associated Canceller object.
This method returns a TcpStream with an associated Canceller and the address of the remote peer.
ⓘImportant traits for Incoming<'a>pub fn incoming(&self) -> Incoming
[src]
Returns an iterator over the connections being received by this listener.
The iteration can be cancelled by the associated Canceller object. If the iteration is cancelled, the next() method will return an error that can be identified with is_cancelled.
pub fn set_ttl(&self, ttl: u32) -> Result<()>
[src]
Sets the value for the IP_TTL
option on this socket.
pub fn ttl(&self) -> Result<u32>
[src]
Gets the value for the IP_TTL
option for this socket.
pub fn take_error(&self) -> Result<Option<Error>>
[src]
Gets the value for the SO_ERROR
option for this socket.
pub fn set_nonblocking(&self, nonblocking: bool) -> Result<()>
[src]
Moves this TCP connection into or out of non blocking mode.
Trait Implementations
Auto Trait Implementations
impl Send for TcpListener
impl !Sync for TcpListener
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,