Struct unix_socket::UnixListener [] [src]

pub struct UnixListener {
    // some fields omitted
}

A structure representing a Unix domain socket server.

Methods

impl UnixListener

fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>

Creates a new UnixListener which will be bound to the specified socket.

Linux provides, as a nonportable extension, a separate "abstract" address namespace as opposed to filesystem-based addressing. If path begins with a null byte, it will be interpreted as an "abstract" address. Otherwise, it will be interpreted as a "pathname" address, corresponding to a path on the filesystem.

fn accept(&self) -> Result<UnixStream>

Accepts a new incoming connection to this listener.

fn try_clone(&self) -> Result<UnixStream>

Create a new independently owned handle to the underlying socket.

The returned UnixListener is a reference to the same socket that this object references. Both handles can be used to accept incoming connections and options set on one listener will affect the other.

fn local_addr(&self) -> Result<SocketAddr>

Returns the socket address of the local half of this connection.

fn incoming<'a>(&'a self) -> Incoming<'a>

Returns an iterator over incoming connections.

The iterator will never return None.

Trait Implementations

impl Debug for UnixListener

fn fmt(&self, fmt: &mut Formatter) -> Result

impl AsRawFd for UnixListener

fn as_raw_fd(&self) -> RawFd

impl<'a> IntoIterator for &'a UnixListener

type Item = Result<UnixStream>

type IntoIter = Incoming<'a>

fn into_iter(self) -> Incoming<'a>