Open jessepollak opened 8 years ago
Hey @jessepollak!
Just looking at this PR, can you help me understand the problem that it fixes? I haven't seen any issues with the device advertisement persisting when it shouldn't, at least when just using airsonos.
The code certainly looks to tidy up the tear-down of the connection, I'm just struggling to picture a sequence of steps where it becomes important - right now when I kill airsonos devices disappear after a few seconds...am I missing something? Thanks!
@jabooth the use case where this was necessary was that I had a long running process where I wanted to start and stop airsonos multiple times (I was working on a mac app to wrap this functionality). When I was programmatically stopping airsonos, the DNS advertisement was not stopping — this PR makes it stop.
The functionality you're seeing (where the devices dissappear) is likely happening because you are starting and stopping the whole airsonos process. When the process is killed, all orphaned advertisements are also killed.
@jessepollak makes total sense, thanks for taking the time to explain 👍
This PR correctly starts and stops the DNS server that advertises Sonos devices. Prior to this PR, if a
Nodetunes
instance was stopped, the DNS would continue to be broadcasted.