Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract unix sockets on Linux platform #623

Open
zeenix opened this issue Dec 14, 2019 · 5 comments
Open

Abstract unix sockets on Linux platform #623

zeenix opened this issue Dec 14, 2019 · 5 comments
Labels
api design Open design questions enhancement New feature or request

Comments

@zeenix
Copy link

zeenix commented Dec 14, 2019

This would be at least very useful for D-Bus on Linux. Although newer software/distros (systemd-based) do not make use of abstract sockets, dbus-daemon by default still uses abstract unix sockets. It would be nice to support these for backwards compitibility. There is an issue on std for this as well with more details.

@zeenix zeenix changed the title abstract unix sockets on Linux platform Abstract unix sockets on Linux platform Dec 14, 2019
@yoshuawuyts yoshuawuyts added api design Open design questions enhancement New feature or request labels Dec 17, 2019
@yoshuawuyts
Copy link
Contributor

We've generally been conservative in what we add, limiting ourselves to only the scope of the stdlib and extensions that are specific to async programming (such as timeout and concurrency). But I'm starting to wonder if we could be a bit more forward in that regard, and introduce extensions that would make sense to propose in std as well.

@zeenix do you maybe have a design outline for what this API would look like? That'd be massively helpful in determining the scope of this addition. The same would apply to #624 too.

@zeenix
Copy link
Author

zeenix commented Dec 17, 2019

We've generally been conservative in what we add, limiting ourselves to only the scope of the stdlib and extensions that are specific to async programming (such as timeout and concurrency). But I'm starting to wonder if we could be a bit more forward in that regard, and introduce extensions that would make sense to propose in std as well.

Cool.

@zeenix do you maybe have a design outline for what this API would look like? That'd be massively helpful in determining the scope of this addition. The same would apply to #624 too.

TBH I haven't yet thought of that. I'll do that and come back to you on this. :) In the meantime, if you've some ideas already, please do share.

@zeenix
Copy link
Author

zeenix commented Dec 17, 2019

Reading the manual page, the first thought that came to mind was to do it the same way as Linux does it but that doesn't map nicely at all to idiomatic Rust and will require changes to Path API itself. How about a Linux-specific constructor to UnixStream instead:

pub async fn connect_abstract(name: OsStr) -> Result<UnixStream>

Looking at the source, it should not be hard to implement in std at least. Currently it seems asyc-std relies on std API so if we go this way, this has to be added to std first, which is not a bad thing IMO. WDYT?

@zeenix
Copy link
Author

zeenix commented Dec 18, 2019

Oh and with this solution, UnixListener will also need a new constructor:

pub async fn bind_abstract(name: OsStr) -> Result<UnixListener>

@gollth
Copy link

gollth commented Apr 13, 2023

I would also be interested in this feature. Since the tracking issue on std is entering its final comment period, how are the plans to port this to async-std as well? =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api design Open design questions enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants