/** * Complete asynchronous connect operation. <em>Note that * asynchronous connect does not work properly in 1.4, * so you should not use this if you run anything older * than 1.5/5.0</em>. * */ private void performConnect(SelectionKey key) { if (Thread.currentThread().isInterrupted()) { return; } Connection c = (Connection) key.attachment(); try { c.connect(); } catch (IOException e) { log.log(Level.FINE, "connect failed", e); try { c.close(); } catch (IOException e2) { log.log(Level.FINE, "close failed", e); } } }