odnoklassniki/one-nio

Socket multicast support

avrecko opened this issue · 3 comments

I find the Socket is missing join/leave multicast support. Any plans to add it? Why was this left out? Would it be fine if this gets included?

I made a quick try without native support here 65bc2aa. Would the API changed be acceptable?

Basically we didn't need this functionality so far, and there were no external requests before.
This is a valuable addition though, and I'll be happy to accept the PR when ready.
API looks fine.
Thank you!

Makes sense. Really liking the library. I'll add this over the weekend or next week.

Time flies. I've taken a stab at it a while back.

For native solution. I looked at the JDK code. It is surprisingly - a lot of code.
I ended up making a java solution using reflection (change fd and call join/leave). Not sold on it but can't see a simpler way of doing it.

For the moment I'll continue to use jdk MulticastSocket/Channel. One unique bonus would be to remove the address allocation on receive. But don't mind the overhead for now.

If need be. I'll revisit this and just open a pull request instead of an issue. Closing this.