Skip to content

Abstract unix sockets on Linux platform #623

Open
@zeenix

Description

@zeenix

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.

Activity

changed the title [-]abstract unix sockets on Linux platform[/-] [+]Abstract unix sockets on Linux platform[/+] on Dec 14, 2019
yoshuawuyts

yoshuawuyts commented on Dec 17, 2019

@yoshuawuyts
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

zeenix commented on Dec 17, 2019

@zeenix
Author

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

zeenix commented on Dec 17, 2019

@zeenix
Author

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

zeenix commented on Dec 18, 2019

@zeenix
Author

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

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

gollth commented on Apr 13, 2023

@gollth

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api designOpen design questionsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zeenix@yoshuawuyts@gollth

        Issue actions

          Abstract unix sockets on Linux platform · Issue #623 · async-rs/async-std