| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,6 +220,16 @@ public Client available() { | |||
| 220 | 220 | for (int i = 0; i < clientCount; i++) { | |
| 221 | 221 | int which = (index + i) % clientCount; | |
| 222 | 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 | + } | ||
| 223 | 233 | if (client.available() > 0) { | |
| 224 | 234 | lastAvailable = which; | |
| 225 | 235 | return client; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments