Ejemplo n.º 1
0
  @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);
  }
Ejemplo n.º 2
0
 @Override
 public boolean isOpen() {
   return channel != null && channel.isOpen() && !isClosed.get();
 }