Struct std::old_io::net::pipe::UnixListenerUnstable [-] [+] [src]

pub struct UnixListener {
    // some fields omitted
}

A value that can listen for incoming named pipe connection requests.

Methods

impl UnixListener

fn bind<P: BytesContainer>(path: P) -> IoResult<UnixListener>

Creates a new listener, ready to receive incoming connections on the specified socket. The server will be named by path.

This listener will be closed when it falls out of scope.

Example

fn main() { fn foo() { use std::old_io::net::pipe::UnixListener; use std::old_io::{Listener, Acceptor}; let server = Path::new("/path/to/my/socket"); let stream = UnixListener::bind(&server); for mut client in stream.listen().incoming() { client.write(&[1, 2, 3, 4]); } } }
use std::old_io::net::pipe::UnixListener;
use std::old_io::{Listener, Acceptor};

let server = Path::new("/path/to/my/socket");
let stream = UnixListener::bind(&server);
for mut client in stream.listen().incoming() {
    client.write(&[1, 2, 3, 4]);
}

Trait Implementations

impl Listener<UnixStream, UnixAcceptor> for UnixListener

fn listen(self) -> IoResult<UnixAcceptor>

impl AsRawFd for UnixListener

fn as_raw_fd(&self) -> Fd

impl AsRawFd for UnixListener

fn as_raw_fd(&self) -> Fd