Skip to content

Commit 9a9ff62

Browse files
committedApr 15, 2019
Add connect with timeout to Client class
1 parent 3d6e4e1 commit 9a9ff62

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎cores/esp32/Client.h

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Client: public Stream
2828
public:
2929
virtual int connect(IPAddress ip, uint16_t port) =0;
3030
virtual int connect(const char *host, uint16_t port) =0;
31+
virtual int connect(IPAddress ip, uint16_t port, int timeout) =0;
32+
virtual int connect(const char *host, uint16_t port, int timeout) =0;
3133
virtual size_t write(uint8_t) =0;
3234
virtual size_t write(const uint8_t *buf, size_t size) =0;
3335
virtual int available() = 0;

6 commit comments

Comments
 (6)

JAndrassy commented on Apr 24, 2019

@JAndrassy
Contributor

you should not add new pure virtual function to Arduino API base classes. other networking libraries don't implement them. now Ethernet, UIPEthernet and other Arduino networking libraries can't be used with this core. esp8266 did it in 2.5.0 and now they fix it for 2.5.1 and now esp32 core developers do the same mistake?

beegee-tokyo commented on Apr 24, 2019

@beegee-tokyo
Contributor

Same problem with TinyGSM after this commit. Doesn't compile anymore.

me-no-dev commented on Apr 25, 2019

@me-no-dev
MemberAuthor

so with or without this change some things do not work. Let's find a common ground and make it work for all. Any proposals?

JAndrassy commented on Apr 25, 2019

@JAndrassy
Contributor

see how the esp8266 core handled it

or like Erhernet library has it would be even better https://www.arduino.cc/en/Reference/EthernetClientSetConnectionTimeout

JAndrassy commented on May 14, 2019

@JAndrassy
Contributor

you still didn't fix this? why do you need to have the connect version with timeout in the base class?

Ibrahimsyah commented on Dec 22, 2024

@Ibrahimsyah

Any update or workaround for this guys? it breaks MqttClient implementation (and other libs that depends on wifiClient i guess)
MqttClient mqttClient(wifiClient);
Currently we can use the older version (v3.0.7) to make it work, but i think this is not a good long term solution as we will miss all latest updates

Please sign in to comment.