signalk-server icon indicating copy to clipboard operation
signalk-server copied to clipboard

[WIP] feature: use vessel name as mdns instanceName

Open tkurki opened this issue 3 years ago • 4 comments

https://tools.ietf.org/html/rfc6763#section-4.1.1

For the http service prefix the vessel name with SK. For the SK service types just use the vessel name.

tkurki avatar Apr 06 '21 19:04 tkurki

added some comment on #1294

wellenvogel avatar Apr 07 '21 07:04 wellenvogel

Added retries, but haven't tested this with Avahi yet. Could you please give it a try @wellenvogel ?

tkurki avatar Apr 07 '21 18:04 tkurki

I have made some tests with avahi daemon. I guess still not reaching the final goal ;-)

  1. Whenever avahi-daemon restarts a new suffix will be appended to the name. This will for sure confuse any clients. Basically the standard recommends to always reuse the last name that you registered successfully. In my code I did it with an extremly simple approach - could be done much better of course. If we would like to be as close as possible to the standard we would need to store the last name persistently.
  2. And if I restart avahi-daemon > MAX_RETRIES ... - the mdns entry will disappear. I guess max retries should only be effective for errors due to name clashes. All the async errors should simply start a re-register without any name change. Maybe this needs a second thought when using the internal mdns implementation. Did not really check this too much.
  3. Small remark for using the shipname: On one hand side this is cool - but: If you start from scratch you will have the hostname first. And once you change your shipname - the names will (surprisingly?) change... At least I guess this needs some clear documentation.

wellenvogel avatar Apr 10 '21 13:04 wellenvogel

#1477 introduces the ability to store "serverstate" properties and the mdns naming status could go there.

tkurki avatar Dec 06 '22 17:12 tkurki