public void run() { udpBootstrap.releaseExternalResources(); } });
@Override protected void doShutdown(long timeout, TimeUnit unit) throws InterruptedException { datagramChannel.close().await(timeout, unit); bootstrap.releaseExternalResources(); }
public void shutdown() { if (ch != null) { ch.close().awaitUninterruptibly(); } if (server != null) { server.releaseExternalResources(); } } }
void shutdown() { allChannels.close().awaitUninterruptibly(); tcpServer.releaseExternalResources(); udpServer.releaseExternalResources(); }
public synchronized void close(boolean force) { if (!(force || state == State.CONNECTED)) { return; } // Stop timer try { if (timer != null) { timer.stop(); } } finally { timer = null; // Close channel try { channels.close().awaitUninterruptibly(); } finally { // Stop bootstrap try { bootstrap.releaseExternalResources(); } finally { bootstrap = null; state = State.DISCONNECTED; } } } }