(SelectionKey key, long endTime)
| 37 | } |
| 38 | |
| 39 | static protected void |
| 40 | blockUntil(SelectionKey key, long endTime) throws IOException { |
| 41 | long timeout = endTime - System.currentTimeMillis(); |
| 42 | int nkeys = 0; |
| 43 | if (timeout > 0) |
| 44 | nkeys = key.selector().select(timeout); |
| 45 | else if (timeout == 0) |
| 46 | nkeys = key.selector().selectNow(); |
| 47 | if (nkeys == 0) |
| 48 | throw new SocketTimeoutException(); |
| 49 | } |
| 50 | |
| 51 | static protected void |
| 52 | verboseLog(String prefix, SocketAddress local, SocketAddress remote, |