Skip to content

Commit 18d7e2d

Browse files
committed
AT server.available fix
- don't return clients of other servers this was a major error - only return clients with data available it is how server.available should work - accept all waiting clients (up to max) because not all of them may have data available and we may want to server.print to all
1 parent 65101b8 commit 18d7e2d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

UNOR4USBBridge/cmds_wifi_netif.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ void CAtHandler::add_cmds_wifi_netif() {
489489
if(!serverClients[i].client) {
490490
serverClients[i].client = serverWiFi[sock]->available();
491491
serverClients[i].server = sock;
492-
break;
493492
}
494493
}
495494

@@ -498,7 +497,9 @@ void CAtHandler::add_cmds_wifi_netif() {
498497
int end = last_server_client_sock;
499498

500499
do {
501-
if(serverClients[last_server_client_sock].client) {
500+
if(serverClients[last_server_client_sock].client
501+
&& serverClients[last_server_client_sock].server == sock
502+
&& serverClients[last_server_client_sock].client.available() > 0) {
502503
client_sock = last_server_client_sock;
503504
break;
504505
}
@@ -867,4 +868,4 @@ void CAtHandler::add_cmds_wifi_netif() {
867868
};
868869
}
869870

870-
#endif
871+
#endif

0 commit comments

Comments
 (0)