View Pit Stop page for race #272 by typeracer — Ghost race
View profile for Alex (typeracer)
Official speed | 40.31 wpm (161.35 seconds elapsed during race) |
---|---|
Race Start | March 20, 2009 4:41:13pm UTC |
Race Finish | March 20, 2009 4:43:55pm UTC |
Outcome | Win (1 of 2) |
Points | 0.00 |
Text | #10000 (Length: 542 characters) /* Read a set of characters from the socket */ StringBuffer command = new StringBuffer(); int expected = 1024; /* Cut off to avoid DoS attack */ while (expected < shutdown.length()) { if (random == null) random = new Random(System.currentTimeMillis()); expected += (random.nextInt() % 1024); } while (expected > 0) { int ch = -1; try { ch = stream.read(); } catch (IOException e) { log.warn("StandardServer.await: read: ", e); ch = -1; } if (ch < 32) /* Control character or EOF terminates loop break; command.append((char) ch); expected--; } |