Skip to content

Commit 991ae80

Browse files
Check client connected (not merely existing) before sending
1 parent 391b08f commit 991ae80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/AdvancedChatServer/AdvancedChatServer.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void loop() {
101101
int count = clients[i].read(buffer, 80);
102102
// write the bytes to all other connected clients
103103
for (byte j=0; j < 8; j++) {
104-
if (j != i && clients[j]) {
104+
if (j != i && clients[j].connected()) {
105105
clients[j].write(buffer, count);
106106
}
107107
}

0 commit comments

Comments
 (0)