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

Allow file descriptor to be passed to UDP socket - just as one can for TCP/Unix sockets #14961

Closed
bangert opened this issue Aug 21, 2017 · 1 comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. feature request Issues that request new features to be added to Node.js.

Comments

@bangert
Copy link

bangert commented Aug 21, 2017

In the net API (https://nodejs.org/api/net.html) Node allows the reception of an existing socket via its file descriptor - in the server.listen(handle[, backlog][, callback]) API. This is, among other things, useful when receiving the listening socket from a supervising daemon.

Unfortunately no such possibility appears to exist for the dgram API (https://nodejs.org/api/dgram.html).

This is a request to add such a feature in the future.
Thanks.

@mscdex mscdex added dgram Issues and PRs related to the dgram subsystem / UDP. feature request Issues that request new features to be added to Node.js. labels Aug 21, 2017
@bnoordhuis
Copy link
Member

I think that would be an acceptable change. Pull requests welcome, the libuv function you are looking for is called uv_udp_open(); uv_tcp_open() is its net module counterpart.

oyyd added a commit to oyyd/node that referenced this issue Aug 4, 2018
dgram: Implement binding an existing `fd`. Allow pass a `fd` property
to `socket.bind()` in dgram.
src: Add `UDPWrap::Open`

Fixes: nodejs#14961
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dgram Issues and PRs related to the dgram subsystem / UDP. feature request Issues that request new features to be added to Node.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants