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

Advanced dgram methods #10381

Open
9 tasks
gvilums opened this issue Apr 19, 2024 · 10 comments
Open
9 tasks

Advanced dgram methods #10381

gvilums opened this issue Apr 19, 2024 · 10 comments
Labels
node.js Compatibility with Node.js APIs tracking An umbrella issue for tracking big features

Comments

@gvilums
Copy link
Contributor

gvilums commented Apr 19, 2024

Tracking issue for the implementation of advanced dgram apis which are not going to ship in the initial version.

  • setBroadcast
  • setTTL
  • setMulticastTTL
  • setMulticastLoopback
  • setMulticastInterface
  • addMembership
  • dropMembership
  • addSourceSpecificMembership
  • dropSourceSpecificMembership
@gvilums gvilums added tracking An umbrella issue for tracking big features node.js Compatibility with Node.js APIs labels Apr 19, 2024
@jebarpg
Copy link

jebarpg commented Apr 29, 2024

When will this issue be tackled?

@Jarred-Sumner
Copy link
Collaborator

When will this issue be tackled?

What do you use these APIs for?

For prioritization, it's helpful to understand the intended usecases and what packages/libraries or companies it's blocking. It seemed like the biggest usecase for dgram previously was dd-trace and possibly Discord voice chat APIs.

@Letrab
Copy link

Letrab commented Apr 29, 2024

When will this issue be tackled?

What do you use these APIs for?

For prioritization, it's helpful to understand the intended usecases and what packages/libraries or companies it's blocking. It seemed like the biggest usecase for dgram previously was dd-trace and possibly Discord voice chat APIs.

Everything using multicast is affected, some examples on top of my mind:

While I understand that the plain UDP support was a priority, I don't think this may be forgotten easily 👍 . In my case it would be a huge addition! Thanks already for your work on this!

@jedahan
Copy link

jedahan commented Apr 29, 2024

setBroadcast (or just setting SO_BROADCAST) is useful for dns-sd/mDNS, which I use in a lot of my projects. Honestly, looking at one of the implementations, I think this could be pulled out to a new ticket and mark as 'good first contribution' or something like that. I'd be willing to tackle it as long as people were patient (history says no lol) in me implementing it in a like, 2-3 week time frame.

from https://github.com/libuv/libuv/blob/520eb622f012c4cc17410ba702f82aebdb93c518/src/unix/udp.c#L1176C1-L1186C2

int uv_udp_set_broadcast(uv_udp_t* handle, int on) {
  if (setsockopt(handle->io_watcher.fd,
                 SOL_SOCKET,
                 SO_BROADCAST,
                 &on,
                 sizeof(on))) {
    return UV__ERR(errno);
  }

  return 0;
}

@benjamingwynn benjamingwynn mentioned this issue Apr 29, 2024
6 tasks
@recanman
Copy link

recanman commented May 1, 2024

I've been wanting to use this library to retrieve metrics from collectd.
It uses addMembership.

@espired
Copy link

espired commented May 9, 2024

Using both Bonjour and custom code with dgram .
Mainly for service discovery

@loicnestler
Copy link

setBroadcast is used by cote.js (a microservice framework that relies on broadcasting)

@kran6a
Copy link

kran6a commented Jun 24, 2024

setMulticastTTL brought me here. It is used by bonjour-service, which I use for service discovery.

@jedahan
Copy link

jedahan commented Jun 30, 2024

setBroadcast (or just setting SO_BROADCAST) is useful for dns-sd/mDNS, which I use in a lot of my projects. Honestly, looking at one of the implementations, I think this could be pulled out to a new ticket and mark as 'good first contribution' or something like that. I'd be willing to tackle it as long as people were patient (history says no lol) in me implementing it in a like, 2-3 week time frame.

from https://github.com/libuv/libuv/blob/520eb622f012c4cc17410ba702f82aebdb93c518/src/unix/udp.c#L1176C1-L1186C2

int uv_udp_set_broadcast(uv_udp_t* handle, int on) {
  if (setsockopt(handle->io_watcher.fd,
                 SOL_SOCKET,
                 SO_BROADCAST,
                 &on,
                 sizeof(on))) {
    return UV__ERR(errno);
  }

  return 0;
}

Started getting the dev environment up today and writing failing test cases. Mentioning it in case someone else has already started work on it so I am not stepping on any toes.

@rgillan
Copy link

rgillan commented Aug 20, 2024

Hi, just ran into this one failing with setBroadcast, being called by matter-node.js, which relies upon mDNS for device discovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
node.js Compatibility with Node.js APIs tracking An umbrella issue for tracking big features
Projects
None yet
Development

No branches or pull requests

10 participants