String line = client.readLine();
if (line != null && line.length() > 20)
System.err.println(line.subSequence(0, 20) + "...");
}
client.disconnect();
// Wait for server thread to stop
int count = 0;
while (servlet.getThread().isAlive() && count < 20) {
Thread.sleep(250);