mDNS Slow Response / Delay

User avatar
seraffimo
Posts: 6
Joined: Wed May 19, 2021 2:46 am

mDNS Slow Response / Delay

Postby seraffimo » 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:

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])));
  
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):
mdns_delay.jpg
mdns_delay.jpg (716.45 KiB) Viewed 1499 times
This happens every time unless I have a keep alive header. Why is this happening? Known bug with mDNS? Am I missing a configuration?

Who is online

Users browsing this forum: No registered users and 164 guests