This repository was archived by the owner on May 17, 2018. It is now read-only.
This repository was archived by the owner on May 17, 2018. It is now read-only.
UnixSockets now on Rust 1.10 #27
Open
Description
Now that this landed on stable (std::os::unix::net)...
Are you moving the crate to @rust-lang-deprecated ?
Are there any features on this crate that didn't land on 1.10-stable?
Activity
sfackler commentedon Jul 7, 2016
Good question! This crate is almost identical to the unix::net module right now. I think the only difference is that this crate will accept abstract namespace addresses while the standard library version will not. I expect we'll deprecate the
UnixStream
,UnixListener
,UnixDatagram
, etc types in this crate when 1.11 or 1.12 lands.I imagine this crate will continue to exist for a while longer by adding more functionality than is currently surfaced in the standard library. There's a pending PR to add
SEQPACKET
support, and there's some other functionality that would be good to support as well like file descriptor transfer and credential transfer.icorderi commentedon Jul 11, 2016
Good answer!
Can we make the
Unix*
in this crate re-export thestd
counterparts and then add the extra functionality through extension traits?sfackler commentedon Jul 11, 2016
Nursery crates need to build against the last two Rust releases (i.e. 1.9 and 1.10 right now), so we'll have to wait a bit to do that.
icorderi commentedon Jul 18, 2016
Ohh, I didn't know about the 2-back requirement on nursery. Thanks!
vi commentedon Dec 22, 2016
Maybe better replace them with
pub use
then (assuming abstract addresses won't be broken by it)?sfackler commentedon Dec 22, 2016
Abstract addresses will be broken as they're not supported by the standard library implementation.
vi commentedon Dec 22, 2016
So until abstract addresses are supported by std this crate is not obsolete.
sfackler commentedon Dec 22, 2016
Assuming a nonzero number of people actually use abstract addresses, which has never been clear to me.
vi commentedon Dec 22, 2016
Like with passing file descriptors over sockets, credentials and SEQPACKET, there may be a loop "nobody uses, let's don't support" <-> "nobody supports it, we won't use it".
Should tricky system programs just fall back to using libc directly (or just fall back to using C)?
sfackler commentedon Dec 22, 2016
By "nonzero number of people", I mean that across all languages, not just Rust. I have not personally heard of it being used anywhere.
The other features you've mentioned would be great to support. There's a stalled PR adding SEQPACKET support, and another one for file descriptor and credential transfer.
vi commentedon Dec 22, 2016
Abstract addresses are useful when:
For example X11 display server typically listens both regular and abstract sockets, allowing to continue using GUI even inside a chroot.
Workaround for missing abstract sockets is using a pair of socats (
socat abstract-listen:qqq unix-connect:qqq & socat unix-listen:qqq2 abstract-connect:qqq
), but it is ugly.sfackler commentedon Dec 22, 2016
Oh great. I don't think there's anything blocking getting them in the standard library implementation on a Linux-specific extension trait.