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

Potential issue joining multicast group? #155

Open
rwarner opened this issue Jan 8, 2025 · 2 comments
Open

Potential issue joining multicast group? #155

rwarner opened this issue Jan 8, 2025 · 2 comments

Comments

@rwarner
Copy link

rwarner commented Jan 8, 2025

Currently debugging an issue potentially with this implementation of SSDP in Golang.

On my current machine, I have no issues with the Minidlna C implementation joining the 239.255.255.250:1900 socket and receiving multicast broadcasts from across subnets.

However, with the same exact interface and calling on this Server in Golang, I only get results for 0.0.0.0:1900 and do not have success with accessing this server like the 239.255.255.250:1900 socket Minidlna has.

Just to be clear, whenever this is ran I only ever get

sudo netstat -tulnp | grep 1900
udp 0 0 0.0.0.0:1900 0.0.0.0:*

Looking here:

dms/ssdp/ssdp.go

Lines 95 to 108 in 07c3224

func makeConn(ifi net.Interface) (ret *net.UDPConn, err error) {
ret, err = net.ListenMulticastUDP("udp", &ifi, NetAddr)
if err != nil {
return
}
p := ipv4.NewPacketConn(ret)
if err := p.SetMulticastTTL(2); err != nil {
log.Print(err)
}
// if err := p.SetMulticastLoopback(true); err != nil {
// log.Println(err)
// }
return
}

Is there any reason there isn't a JoinGroup used?

e.g.

// Bind the multicast group to the interface
if err := p.JoinGroup(&iface, groupAddr); err != nil {
    logger.Debugf("Failed to join multicast group: %v", err)
    return err
}

I haven't had a chance to try to compile a change myself with this repo and then re-implement the library in the other application but wanted to see if there was any decision made with the implementation for this as I haven't been having success as is.

Thanks

@anacrolix
Copy link
Owner

I think I wrote and tested this part in 2012 or so. I'm definitely open to improvements if they fix things for you! Thanks

@rwarner
Copy link
Author

rwarner commented Jan 11, 2025

No problem sounds good. Looking at the commits I figured this might be the case. Will poke around, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants