Struct std::io::net::pipe::UnixListenerExperimental [-]  [+] [src]

pub struct UnixListener {
    // some fields omitted
}

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

Methods

impl UnixListener

fn bind<P: ToCStr>(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() { #![allow(unused_must_use)] use std::io::net::pipe::UnixListener; use std::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::io::net::pipe::UnixListener;
use std::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 AsInner<UnixListenerImp> for UnixListener

fn as_inner(&self) -> &UnixListenerImp

impl AsRawHandle for UnixListener

fn as_raw_handle(&self) -> Handle

impl AsRawHandle for UnixListener

fn as_raw_handle(&self) -> Handle