Network reader should close if it has to exit

This commit is contained in:
Manevolent
2018-08-10 22:20:03 -04:00
parent 2f7b5a376b
commit 83b2f5c46f
2 changed files with 10 additions and 3 deletions
@@ -866,12 +866,19 @@ public abstract class AbstractTeamspeakClientSocket
while (isReading()) { while (isReading()) {
try { try {
readQueue.put(readPacket()); readQueue.put(readPacket());
} catch (Exception e) { } catch (Throwable e) {
if (e instanceof InterruptedException) continue; if (e instanceof InterruptedException) continue;
Ts3Debugging.debug("Problem reading packet", e); e.printStackTrace();
break;
} }
} }
try {
setState(ClientConnectionState.DISCONNECTED);
} catch (Throwable e1) {
}
} }
} }
@@ -151,7 +151,7 @@ public class ServerConnectionTest {
client.subscribeAll(); client.subscribeAll();
client.waitForState(ClientConnectionState.DISCONNECTED, 10000L); client.waitForState(ClientConnectionState.DISCONNECTED, 100000000L);
} catch (Throwable ex) { } catch (Throwable ex) {
ex.printStackTrace(); ex.printStackTrace();
} }