blob: e9fc5e1c1d5e67bb10718aeb7a5e9436b5ce175b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#![feature(unix_socket_ancillary_data)]
use std::os::unix::net::{SocketAncillary, UnixDatagram};
fn main() {
let sock = UnixDatagram::unbound().expect("failed to create socket");
sock.connect("/tmp/newton.sock").expect("failed to connect");
let mut ancillary_buffer = [0; 128];
let mut ancillary = SocketAncillary::new(&mut ancillary_buffer);
ancillary.add_fds(&[1]);
sock.send_vectored_with_ancillary(&mut [], &mut ancillary).expect("failed to send");
println!("hi");
loop {}
}
|