Skip to content

Instantly share code, notes, and snippets.

@wycats
Created July 10, 2014 21:15
Show Gist options
  • Save wycats/bb9ad79532265974efbb to your computer and use it in GitHub Desktop.
Save wycats/bb9ad79532265974efbb to your computer and use it in GitHub Desktop.
use std::io::{Listener,Acceptor};
use std::io::net::unix::UnixListener;
pub fn main() {
let listener = UnixListener::bind(&Path::new("repro.sock")).unwrap();
let mut acceptor = listener.listen().unwrap();
acceptor.set_timeout(Some(1_000));
for _ in acceptor.incoming() {
println!("GOT CONN");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment