Struct mio_uds::UnixListener
[−]
[src]
pub struct UnixListener { /* fields omitted */ }A structure representing a Unix domain socket server.
This listener can be used to accept new streams connected to a remote
endpoint, through which the read and write methods can be used to
communicate.
Methods
impl UnixListener[src]
fn bind<P: AsRef<Path>>(path: P) -> Result<UnixListener>
Creates a new UnixListener bound to the specified socket.
fn from_listener(stream: UnixListener) -> Result<UnixListener>
Consumes a standard library UnixListener and returns a wrapped
UnixListener compatible with mio.
The returned stream is moved into nonblocking mode and is otherwise ready to get associated with an event loop.
fn accept(&self) -> Result<Option<(UnixStream, SocketAddr)>>
Accepts a new incoming connection to this listener.
When established, the corresponding UnixStream and the remote peer's
address will be returned as Ok(Some(...)). If there is no connection
waiting to be accepted, then Ok(None) is returned.
If an error happens while accepting, Err is returned.
fn try_clone(&self) -> Result<UnixListener>
Creates 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 local socket address of this listener.
fn take_error(&self) -> Result<Option<Error>>
Returns the value of the SO_ERROR option.
Trait Implementations
impl Debug for UnixListener[src]
impl Evented for UnixListener[src]
fn register(
&self,
poll: &Poll,
token: Token,
events: Ready,
opts: PollOpt
) -> Result<()>
&self,
poll: &Poll,
token: Token,
events: Ready,
opts: PollOpt
) -> Result<()>
Register self with the given Poll instance. Read more
fn reregister(
&self,
poll: &Poll,
token: Token,
events: Ready,
opts: PollOpt
) -> Result<()>
&self,
poll: &Poll,
token: Token,
events: Ready,
opts: PollOpt
) -> Result<()>
Re-register self with the given Poll instance. Read more
fn deregister(&self, poll: &Poll) -> Result<()>
Deregister self from the given Poll instance Read more
impl AsRawFd for UnixListener[src]
impl IntoRawFd for UnixListener[src]
fn into_raw_fd(self) -> i32
Consumes this object, returning the raw underlying file descriptor. Read more
impl FromRawFd for UnixListener[src]
unsafe fn from_raw_fd(fd: i32) -> UnixListener
Constructs a new instance of Self from the given raw file descriptor. Read more