schollz / peerdiscovery

Pure-Go library for cross-platform local peer discovery using UDP multicast :woman: :repeat: :woman:
MIT License
644 stars 56 forks source link

can't find each other #12

Closed xurwxj closed 4 years ago

xurwxj commented 4 years ago
discoveries, _ := peerdiscovery.Discover(peerdiscovery.Settings{Limit: -1,TimeLimit: -1})
for _, d := range discoveries {
    fmt.Printf("discovered '%s'\n", d.Address)
}

run on a, b and c that are independent mac. result: a can discover b and c b can discover c c can't discover a or b

go 1.14 mac 10.15.3

schollz commented 4 years ago

Maybe try changing the multicast address?

xurwxj commented 4 years ago

They are both in same network. 10.20.10.0/24. @schollz what's your advice for multicast address?

schollz commented 4 years ago

One of the settings is the multicast address.

You can use any of 224.0.0.0/4. By default its 239.255.255.25. Not sure this will work for you, because it didn't work for me when I tried with similar issues.

Generally I have noticed sometimes some devices connecting to a device, but not from. I haven't been able to figure this out, I think its an underlying network thing. But in each of my cases it was different systems (raspberry pi -> ubuntu laptop) or (ubuntu laptop -> windows). Though in all these cases there was one direction that would work. This is similar to your case where everyone can see "c" but "c" can't see anyone else.

xurwxj commented 4 years ago

resovle it after changed multicast address. TKS @schollz