maximkulkin / esp-homekit

Apple HomeKit accessory server library for ESP-OPEN-RTOS
MIT License
1.12k stars 170 forks source link

mdns performance and correctness #7

Closed HomeACcessoryKid closed 6 years ago

HomeACcessoryKid commented 6 years ago

The (current) code you use is not handling mdns correctly and is very very slow. an iPhone taken by a user will emit an mdns query and it takes up to two seconds before it even starts emitting a TCP SYN packet. This should be like 100ms max.

Also, the current code does not comply to the rules of an mdns responder. It answers those queries that it shouldn't (if our name is already in the answer section) and it omits the transmission of its existence at startup and TTL expiry.

I also value open code reused from others, but considering the very limited mission this mdns responder has to deliver, I would appreciate the possibility by using a #define to use my mdns code instead of the current one. I'll be glad to explain why it works, e.g. in a wiki page.

maximkulkin commented 6 years ago

Looks like we are pretty happy with technically not 100% correct mDNS implementation. Taking into account limited resources, I think it does not make sense to pursue 100% correctness.

If not, please state the case and reopen.