There was an error while loading. Please reload this page.
1 parent 10727da commit 3f131d7Copy full SHA for 3f131d7
java/libraries/net/src/processing/net/Server.java
@@ -220,6 +220,16 @@ public Client available() {
220
for (int i = 0; i < clientCount; i++) {
221
int which = (index + i) % clientCount;
222
Client client = clients[which];
223
+ //Check for valid client
224
+ if (!client.active()){
225
+ removeIndex(which); //Remove dead client
226
+ i--; //Don't skip the next client
227
+ //If the client has data make sure lastAvailable
228
+ //doesn't end up skipping the next client
229
+ which--;
230
+ //fall through to allow data from dead clients
231
+ //to be retreived.
232
+ }
233
if (client.available() > 0) {
234
lastAvailable = which;
235
return client;
0 commit comments