From Gert.Willems at niko.eu Tue Mar 9 16:07:32 2021 From: Gert.Willems at niko.eu (Willems Gert (GWI)) Date: Tue, 9 Mar 2021 16:07:32 +0000 Subject: [avahi] [spoofed message] - Re: AVAHI_BROWSER_NEW event when IP address changes is detected in cache In-Reply-To: References: , , Message-ID: Hi again, I would just like to confirm that indeed, you have to leave the service resolver in your client that you get with the resolve_callback alone. If you don't delete this object then it retriggers although you have to wait for about 4 to 5 minutes for this to happen after the change of the address took place. It is a very simple procedure and it should be better explained in the sample code that you find when you want to write your own client. Anyhow, thank you for your help, Trent! cheers, Gert ________________________________ From: avahi on behalf of Willems Gert (GWI) Sent: Tuesday, February 23, 2021 12:20 PM To: Avahi ML Subject: [spoofed message] - Re: [avahi] AVAHI_BROWSER_NEW event when IP address changes is detected in cache CAUTION: This email originated from outside the organization. Do not click on links or open attachments unless you recognize the sender and know the content is safe. Hi Trent, thank for responding so soon to my question. I'm a bit confused about your comment to leave the ServiceResolver running, are you talking about a process or a specific object in the code that I need to keep running in a thread. There is such a thing as the avahi-resolve client that indeed returns the correct address when I run that but that isn't something that keeps on running, it returns immediatly. Then there is the AvahiServiceResolver object that you can create via the lookup.h include, this one we indeed use and create when the AVAHI_BROWSER_NEW event comes and it is via this ones resolve_callback function that we receive the address when that one is triggered when there is an AVAHI_RESOLVER_FOUND event happens. It indeed remains alive in its thread, however this remains silent when an address change occurs. regards, Gert ________________________________ From: avahi on behalf of Trent Lloyd Sent: Monday, February 22, 2021 3:52 PM To: Avahi ML Subject: Re: [avahi] AVAHI_BROWSER_NEW event when IP address changes is detected in cache CAUTION: This email originated from outside the organization. Do not click on links or open attachments unless you recognize the sender and know the content is safe. Hi Willems, For detecting this case I think you want to leave the ServiceResolver running. Do you get a new hit on the ServiceResolver if you leave it running? Trent Sent from my iPhone On 22 Feb 2021, at 4:08 pm, Willems Gert (GWI) wrote: ? Hello, I'm new to the mailing list and have been digging around in the code of avahi for the last couple of days to figure out how it would be possible that the server would post a AVAHI_BROWSER_NEW event when an IP address change has been detected. I work in Niko, which is a Belgian company that mainly focusses on domotica applications. We use avahi in our product to detect what the devices are on the network. We use the client resolve_callback function in order to do this and this works find however we do have a problem that we don't get a trigger when there is an IP address change because of a reboot of the DHCP server or some other reason. Because of this we lose connection with our devices and other then a full reboot there is no way of solving that. I've been concentrating on the 0.7 release since that is the one that we are using. I've found out that the avahi cache does detect a change of IP address and that it even cleans up the old address. So it was a bit surprising to see that this doesn't lead to an event towards the client (like an AVAHI_BROWSER_NEW). As far as I can tell only new PTR records seem to lead to an actual event that triggers the client. So my question is, if I would like to create a custom version where address changes do lead to AVAHI_BROWER_NEW events, how would be the best way to go about and do this? regards, Gert Willems _______________________________________________ avahi mailing list avahi at lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/avahi -------------- next part -------------- An HTML attachment was scrubbed... URL: