We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e833f6 commit 0633945Copy full SHA for 0633945
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