public ChannelGroupFuture unbind() { Map<Integer, ChannelFuture> futures = new LinkedHashMap<Integer, ChannelFuture>(size()); for (Channel c: serverChannels.values()) { futures.put(c.getId(), c.unbind().awaitUninterruptibly()); } for (Channel c: nonServerChannels.values()) { futures.put(c.getId(), c.unbind()); } return new DefaultChannelGroupFuture(this, futures); }
/** * Allows to close the communication channel */ void closeConnection() { LOG.debug("Closing communication channel..."); if (listeningChannel != null) { LOG.debug("\tUnbinding listening channel {}", listeningChannel); listeningChannel.unbind().awaitUninterruptibly(); LOG.debug("\tListening channel {} unbound", listeningChannel); } if (channelGroup != null) { LOG.debug("\tClosing channel group {}", channelGroup); channelGroup.close().awaitUninterruptibly(); LOG.debug("\tChannel group {} closed", channelGroup); } }
/** * Allows to close the communication channel */ void closeConnection() { LOG.debug("Closing communication channel..."); if (listeningChannel != null) { LOG.debug("\tUnbinding listening channel {}", listeningChannel); listeningChannel.unbind().awaitUninterruptibly(); LOG.debug("\tListening channel {} unbound", listeningChannel); } if (channelGroup != null) { LOG.debug("\tClosing channel group {}", channelGroup); channelGroup.close().awaitUninterruptibly(); LOG.debug("\tChannel group {} closed", channelGroup); } }
/** * Allows to close the communication channel */ void closeConnection() { LOG.debug("Closing communication channel..."); if (listeningChannel != null) { LOG.debug("\tUnbinding listening channel {}", listeningChannel); listeningChannel.unbind().awaitUninterruptibly(); LOG.debug("\tListening channel {} unbound", listeningChannel); } if (channelGroup != null) { LOG.debug("\tClosing channel group {}", channelGroup); channelGroup.close().awaitUninterruptibly(); LOG.debug("\tChannel group {} closed", channelGroup); } }
@Override protected void doSuspend() throws Exception { if (channel != null) { LOG.debug("ServerBootstrap unbinding from {}:{}", configuration.getHost(), configuration.getPort()); ChannelFuture future = channel.unbind(); future.awaitUninterruptibly(); } }
public synchronized void stop(boolean emergencyCloseDown) { LOGGER.info("[{}] Stopping Odette FTP service...", this); if (timer != null) { } if (channel != null) { // stop accepting incoming connections channel.unbind(); if (emergencyCloseDown) { ChannelGroupFuture closeActiveChannels = activeChildChannels.close(); // TODO send Emergency Close Down End Session to all channels open // TODO maybe safe to include a timeout argument here closeActiveChannels.awaitUninterruptibly(); } else { ChannelGroupFuture activeChannelsCloseFuture = getChannelGroupCloseFuture(activeChildChannels); // TODO maybe safe to include a timeout argument here activeChannelsCloseFuture.awaitUninterruptibly(); } timer.stop(); channel.getFactory().releaseExternalResources(); channel = null; timer = null; } LOGGER.info("[{}] Odette FTP is stopped.", this); }
ChannelFuture unbindFuture = transport.unbind(); if (unbindFuture.isDone()) { handleHttpTransportUnbindComplete(httpUnbindChannel, httpUnbindFuture, unbindFuture);
ChannelFuture unbindFuture = transport.unbind(); if (unbindFuture.isDone()) { handleTlsTransportUnbindComplete(tlsUnbindChannel, tlsUnbindFuture, unbindFuture);
@Override protected void unbindRequested(ChannelPipeline pipeline, ChannelStateEvent evt) throws Exception { final BBoshServerChannel bboshUnbindChannel = (BBoshServerChannel) evt.getChannel(); final ChannelFuture bboshUnbindFuture = evt.getFuture(); ChannelAddress bboshLocalAddress = bboshUnbindChannel.getLocalAddress(); URI bboshLocation = bboshLocalAddress.getLocation(); if (!bboshBindings.remove(bboshLocation, bboshUnbindChannel)) { bboshUnbindFuture.setFailure(new ChannelException("Channel not bound")); return; } Channel transport = bboshUnbindChannel.getTransport(); ChannelFuture unbindFuture = transport.unbind(); if (unbindFuture.isDone()) { handleBBoshTransportUnbindComplete(bboshUnbindChannel, bboshUnbindFuture, unbindFuture); } else { unbindFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture unbindFuture) throws Exception { handleBBoshTransportUnbindComplete(bboshUnbindChannel, bboshUnbindFuture, unbindFuture); } }); } }