6 ms·
No you didn't miss. I mixed the concept, UDP broadcast similar to mDNS, yes part of net library. actual mDNS like visible in Finder and actual RFC implementatio
by coldstartops 5mo ago
No you didn't miss. I mixed the concept, UDP broadcast similar to mDNS, yes part of net library. actual mDNS like visible in Finder and actual RFC implementation not part of standard library. What I was trying to say was easy to make "mdns-ish" with just standard lib, rush typed it and ended up like that.
- klabb3 5mo agoYeah I implemented my own in Go because I was unhappy with the 3p ones, so that’s why I reacted. It’s surprisingly hard to get right, in particular: 1. Backoff and timer logic to not flood network. 2. Caching entries for the same reason. 3. Handling multiple network interfaces, and detecting when they changed.
- coldstartops 5mo agohah, I feel you for 3. I was constantly hitting the loopback network interface and I was like, why no discovery. in hindisght bad idea to always get the first entry in an array, now go through a list of network interfaces that i spam. for 1. i send a mutlicast of max 512 bytes on 224.0.0.167:26999 every 3 seconds 2. not really caching, just have a map of people that get discovered. and god bless, I just rolled with this. if people will use the tool and they will complain about it, then it will be a problem for later. for me between my home devices did not notice inconveniences. in total around 200 lines of golang.