/** * Perform read operation on channel which is now ready for reading */ private void performRead(SelectionKey key) { if (Thread.currentThread().isInterrupted()) { return; } Connection c = (Connection) key.attachment(); try { c.read(); } catch (IOException e) { log.log(Level.FINE, "read failed", e); try { c.close(); } catch (IOException e2) { log.log(Level.FINE, "close failed", e); } } }