Skip to content

WiFiClient write doesn't consider timeout #5668

Closed
@timdah

Description

@timdah

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12E]
  • Development Env: [PlatformIO]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Wemos D1 mini r2]
  • Flash Size: [4MB]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [921600]

Problem Description

Seems like the timeout isn't considered for write operations in my case.
When i run the following code and enter an area with bad wifi signal the write method returns after 300-400 ms but the timeout was set to 10 ms. It's blocking the rest of the program too long.
It's weird, because the problem should be fixed since #3257

Sketch

WiFiClient* client = new WiFiClient();
client->setTimeout(10);
...
unsigned long ptime = millis();
uint16_t rc = client->write(buf+(MQTT_MAX_HEADER_SIZE-hlen),length+hlen);
Serial.print("writetime: ");
Serial.println(millis()-ptime);

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions