[][src]Struct hyper::server::conn::AddrIncoming

#[must_use = "streams do nothing unless polled"]
pub struct AddrIncoming { /* fields omitted */ }

A stream of connections from binding to an address.

Methods

impl AddrIncoming[src]

pub fn bind(addr: &SocketAddr) -> Result<Self>[src]

Creates a new AddrIncoming binding to provided socket address.

pub fn local_addr(&self) -> SocketAddr[src]

Get the local address bound to this listener.

Important traits for &'_ mut F
pub fn set_keepalive(&mut self, keepalive: Option<Duration>) -> &mut Self[src]

Set whether TCP keepalive messages are enabled on accepted connections.

If None is specified, keepalive is disabled, otherwise the duration specified will be the time to remain idle before sending TCP keepalive probes.

Important traits for &'_ mut F
pub fn set_nodelay(&mut self, enabled: bool) -> &mut Self[src]

Set the value of TCP_NODELAY option for accepted connections.

pub fn set_sleep_on_errors(&mut self, val: bool)[src]

Set whether to sleep on accept errors.

A possible scenario is that the process has hit the max open files allowed, and so trying to accept a new connection will fail with EMFILE. In some cases, it's preferable to just wait for some time, if the application will likely close some files (or connections), and try to accept the connection again. If this option is true, the error will be logged at the error level, since it is still a big deal, and then the listener will sleep for 1 second.

In other cases, hitting the max open files should be treat similarly to being out-of-memory, and simply error (and shutdown). Setting this option to false will allow that.

Default is true.

Trait Implementations

impl Debug for AddrIncoming[src]

impl Stream for AddrIncoming[src]

type Item = Result<AddrStream>

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]