Skip to content

can't customize the WifiClient timeout for connect #3247

Closed
@zli117

Description

@zli117

Basic Infos

Hardware

Hardware: NodeMCUv2, ESP-12E
Core Version: ?

Description

The WifiClient connect function hang the program

Settings in IDE

Doesn't matter

Sketch

#include <Arduino.h>

void setup() {

}

void loop() {
        WiFiClient client;
        IPAddress ipAddr;
        ipAddr.fromString(IPADDR);
        Serial.println("Trying to log");
        if (client.connect(ipAddr, PORT)) {
            client.print(msg);
            Serial.println("Logged");
        }
        // Have some other time critical stuff here. The connect takes too long if the ipaddress doesn't exist. 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions