Nimrodda / flutter_nsd

A Flutter plugin that enables Network Service Discovery (mDNS) on various platforms via their native APIs.
Apache License 2.0
34 stars 8 forks source link

Service lost enhancement #31

Closed jnstahl closed 2 years ago

jnstahl commented 2 years ago

resolves https://github.com/Nimrodda/flutter_nsd/issues/28 for windows

This was actually less complex as I already send a MDNS broadcast every 10 seconds, and I already keep map of known services to filter the duplicates. All I needed to do was to add a 'last seen' timestamp, and after every cycle I check if a service hasn't been seen for more than 30 seconds.

jnstahl commented 2 years ago

I redid the PR as my innocent print statement next to the //TODO in onServiceLost was causing the lint checks to fail