libs-team
libs-team copied to clipboard
Implementing UnixSocketExt traits for solaris/illumos ; starting with the unix_socket_exclbind feature
Proposal
Problem statement
Goal is to add the possibility, for the aforementioned systems, to be able to control how the incoming connections can bind to a given socket, discarding the SO_REUSEADDR
setting.
Motivating examples or use cases
#![feature(unix_socket_exclbind)]
use std::os::solaris::net::UnixSocketExt;
use std::os::unix::net::UnixDatagram;
fn main() -> std::io::Result<()> {
let sock = UnixDatagram::unbound()?;
sock.set_exclbind(true).unwrap();
Ok(())
}
Links and related work
https://github.com/rust-lang/rust/pull/123476