[][src]Struct nng::ListenerOptions

pub struct ListenerOptions { /* fields omitted */ }

Configuration utility for nanomsg-next-generation listeners.

This object allows for the configuration of listeners before they are started. If it is not necessary to change listener settings or to close the listener without closing the socket, then Socket::listen provides a simpler interface and does not require tracking an object.

Methods

impl ListenerOptions[src]

pub fn new(socket: &Socket, url: &str) -> Result<Self>[src]

Creates a new listener object associated with the given socket.

Note that this does not start the listener. In order to start the listener, this object must be consumed by ListenerOptions::start.

pub fn start(self, nonblocking: bool) -> Result<Listener, (Self, Error)>[src]

Cause the listener to start listening on the address with which it was created.

Normally, the act of "binding" to the address indicated by url is done synchronously, including any necessary name resolution. As a result, a failure, such as if the address is already in use, will be returned immediately. However, if nonblocking is specified then this is done asynchronously; furthermore any failure to bind will be periodically reattempted in the background.

The returned handle controls the life of the listener. If it is dropped, the listener is shut down and no more messages will be received on it.

Trait Implementations

Auto Trait Implementations

Blanket Implementations

impl<T> Options for T where
    T: HasOpts, 
[src]

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

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

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

type Error = !

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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