Skip to content

Commit 6f56677

Browse files
RobAtticuscmaglie
authored andcommitted
Fixes YunClient's connected() to behave like other Clients (WiFiClient, EthernetClient, etc)
1 parent c4de750 commit 6f56677

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Bridge/src/YunClient.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ void YunClient::flush() {
114114
uint8_t YunClient::connected() {
115115
if (!opened)
116116
return false;
117+
// Client is "connected" if it has unread bytes
118+
if (available())
119+
return true;
120+
117121
uint8_t cmd[] = {'L', handle};
118122
uint8_t res[1];
119123
bridge.transfer(cmd, 2, res, 1);

0 commit comments

Comments
 (0)