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

Sending/receiving ancillary data (FDs) over Unix domain sockets #53391

Open
joepie91 opened this issue Jun 8, 2024 · 1 comment
Open

Sending/receiving ancillary data (FDs) over Unix domain sockets #53391

joepie91 opened this issue Jun 8, 2024 · 1 comment
Labels
feature request Issues that request new features to be added to Node.js.

Comments

@joepie91
Copy link
Contributor

joepie91 commented Jun 8, 2024

What is the problem this feature will solve?

Ability to send/receive ancillary data over Unix domain sockets. This is necessary for eg. implementation of the Wayland protocol (which uses this feature for high-performance sharing of memory buffers between compositors and clients), and thereby allows implementing graphical applications for Wayland systems.

What is the feature you are proposing to solve the problem?

Some kind of extension to the net core module that allows for sending file descriptors over (Unix domain) sockets, those being sent as ancillary data. Support for this seems to already exist in libuv, from what I've been able to find; it just isn't wired to the net core module in any way.

What alternatives have you considered?

I've looked through all the relevant source code in core modules (both the JS and C++ side) to figure out if there is already a way to do this, but was unable to find one; it seems that the StreamBase:Writev method hard-sets the ancillary FD to a null pointer, for instance.

Sending/receiving FDs is a hard requirement for Wayland protocol implementation, and there are no alternative mechanisms. I'm unable to write C/C++ and therefore cannot talk to libuv directly myself.

@joepie91 joepie91 added the feature request Issues that request new features to be added to Node.js. label Jun 8, 2024
@benjamingr
Copy link
Member

@nodejs/libuv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js.
Projects
Status: Awaiting Triage
Development

No branches or pull requests

2 participants