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