Skip to content

Any reason to stop UDP port when Wifi is reconnected? #969

Closed
@polvora

Description

@polvora

Thanks you all for your work here.

I've been working with DNSServer library in WIFI_AP_STA mode and noticed that everytime it reconnects to an AP my DNS server stopped working since ESP8266WiFi.cpp stops the incomming UDP segments:

void ESP8266WiFiClass::_eventCallback(void* arg)
{
    System_Event_t* event = reinterpret_cast<System_Event_t*>(arg);
    DEBUGV("wifi evt: %d\r\n", event->event);

    if (event->event == EVENT_STAMODE_DISCONNECTED) {
        WiFiClient::stopAll();
        WiFiUDP::stopAll();
    }
}

Is this to prevent anything like a leak or does DNSServer library need a fix?
I ask this because i simply commented the line that stopped udp and it seems to work fine.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions