@Override public GrizzlyFuture close() throws IOException { if (!isClosed.getAndSet(true)) { preClose(); notifyCloseListeners(); notifyProbesClose(this); channel.close(); // return transport.getSelectorHandler().executeInSelectorThread( // selectorRunner, new Runnable() { // // @Override // public void run() { // try { // ((AIOTransport) transport).closeConnection(AIOConnection.this); // } catch (IOException e) { // logger.log(Level.FINE, "Error during connection close", e); // } // } // }, null); } return ReadyFutureImpl.create(this); }
@Override public boolean isOpen() { return channel != null && channel.isOpen() && !isClosed.get(); }