Skip to content

Commit 71b1ca8

Browse files
committed
EthernetClient: fix is_connected
1 parent b1f1c02 commit 71b1ca8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ArduinoCore-Linux/cores/arduino/Ethernet.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class EthernetClient : public Client {
4848
writeBuffer = RingBufferExt(bufferSize);
4949
this->sock = sock;
5050
setTimeout(timeout);
51+
is_connected = sock.connected();
5152
}
5253

5354
//EthernetClient(const EthernetClient&) = delete;
@@ -199,7 +200,7 @@ class EthernetClient : public Client {
199200
int bufferSize = 256;
200201
RingBufferExt readBuffer;
201202
RingBufferExt writeBuffer;
202-
bool is_connected;
203+
bool is_connected = false;
203204

204205
int read(uint8_t* buffer, size_t len) override {
205206
Logger.debug(WIFICLIENT, "read");

0 commit comments

Comments
 (0)