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

osc server discovery #33

Open vlappa opened 1 year ago

vlappa commented 1 year ago

I'm looking for something that can discover if there is a osc server (open sound control, udp) running on the same computer or in the local network.

Let's say there is a osc server with certain functionality and a tool is used to find if such a server is running (and on which port). A application might then start a server if none is running, give the user the option to connect to a running server, or let the user choose which server it wants to use.

Could peerdiscovery be helpful for this? I saw this project is using bonjour/avahi. https://github.com/rbdannenberg/o2

I'm just orientating at the moment for possible solutions and stumbled upon this project.

schollz commented 1 year ago

Hi @vlappa, yes absolutely. In fact I'm using peerdiscovery for exactly this purpose: - I have multiple OSC servers on a network and I want them to be aware of each other so I'm using peerdiscovery to connect them: https://github.com/schollz/zxcvbn/blob/main/lib/oscconnect/main.go

vlappa commented 1 year ago

Ok cool. The way to understand how this works is understanding how multicast is working I guess. Skimming over it suggests all clients/servers should support this and talk with each other on the same port.

Avahi doesn't need this I think, but not sure how easy it is for Desktop users to configure Avahi and if it conflicts with using systemd or not. https://wiki.archlinux.org/title/Avahi

I've this in the back of my head, I need to dive into it a little deeper at some point.