mDNS Slow Response / Delay
Posted: Wed Sep 15, 2021 7:55 pm
Has anyone seen this behavior with mDNS? I am using ESP32S2, esp-idf 4.2, running a web server on an AP, configured mDNS as such:
When I run curl command, postman or use browser and hit the URI endpoint using [MDS_HOST_NAME].local (e.g. (curl http://senditfcs.local/...) vs using the IP address , I see a three sec delay in Wireshark as follows (note delay between frames 6 and 7):
This happens every time unless I have a keep alive header. Why is this happening? Known bug with mDNS? Am I missing a configuration?
Code: Select all
esp_err_t err = mdns_init();
if (err != ESP_OK) {
ESP_LOGE(TAG,"MDNS Init failed: %d\n", err);
return;
}
mdns_hostname_set(MDNS_HOST_NAME); //senditfcs
mdns_instance_name_set(MDNS_INSTANCE);
mdns_txt_item_t serviceTxtData[] = {
{"board", "esp32"},
{"path", "/"}
};
ESP_ERROR_CHECK(mdns_service_add("ESP32-WebServer", "_http", "_tcp", 80, serviceTxtData,
sizeof(serviceTxtData) / sizeof(serviceTxtData[0])));
This happens every time unless I have a keep alive header. Why is this happening? Known bug with mDNS? Am I missing a configuration?