Skip to content

Conversation

@ntninja
Copy link

@ntninja ntninja commented Dec 19, 2025

Motivation

Currently connecting/binding to the abstract namespace only works with stream Unix sockets.

Solution

This adds binding to abstract namespace names on datagram Unix sockets and returns error and documents limitations for other datagram socket OPs, as there is no support for specifying a SocketAddr for these in MIO currently unfortunately.

@ntninja ntninja force-pushed the feat-uds-abstract-dgram branch 4 times, most recently from 5d38baa to d267424 Compare December 19, 2025 16:49
@ADD-SP ADD-SP added A-tokio Area: The main tokio crate M-net Module: tokio/net labels Dec 19, 2025
@ntninja
Copy link
Author

ntninja commented Dec 19, 2025

This the test failure related to this? (Doesn’t look to me, at least.)

@ntninja
Copy link
Author

ntninja commented Dec 28, 2025

“Fixed” CI by rebasing

@Darksonn
Copy link
Member

Darksonn commented Jan 1, 2026

I have a hard time understanding how and whether this changes behavior of Tokio.

Please add some tests that attempt to use these APIs with the abstract namespace, and set up your commits so that I can see the behavior before and after your change.

Deduplicates the path2socket logic into our `SocketAddr` constructor. Where MIO
currently doesn’t support using a STD Unix SocketAddr, a warning for this
inconsistent behaviour is added to the documentation.
@ntninja ntninja force-pushed the feat-uds-abstract-dgram branch 6 times, most recently from c638435 to 7503643 Compare January 6, 2026 18:53
@ntninja ntninja force-pushed the feat-uds-abstract-dgram branch from 7503643 to c1418df Compare January 6, 2026 19:31
@ntninja
Copy link
Author

ntninja commented Jan 6, 2026

@Darksonn: Added a test for using UnixDatagram::bind() with an appropriately formatted abstract socket path. It tests that this fails in the expected way on non-Linux as well. The usage of the standard library support for abstract datagram unix domain sockets to send a datagram to the bound socket is because it is impossible to implement support for sending on the UnixDatagram object without prior support in mio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate M-net Module: tokio/net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants