@Override public synchronized InetSocketAddress getListenerAddress() { return ((InetSocketAddress) serverChannel.localAddress()); }
public int port() { if (serverChannel == null) { return port; } else { return ((InetSocketAddress) serverChannel.localAddress()).getPort(); } }
@Override public synchronized void stop() { if (!running) { return; } LOG.info("Stopping server on " + this.serverChannel.localAddress()); if (authTokenSecretMgr != null) { authTokenSecretMgr.stop(); authTokenSecretMgr = null; } allChannels.close().awaitUninterruptibly(); serverChannel.close(); scheduler.stop(); closed.countDown(); running = false; }
try { serverChannel = bootstrap.bind(this.bindAddress).sync().channel(); LOG.info("Bind to {}", serverChannel.localAddress()); } catch (InterruptedException e) { throw new InterruptedIOException(e.getMessage());
public int port() { if (serverChannel == null) { return port; } else { return ((InetSocketAddress) serverChannel.localAddress()).getPort(); } }
@Override public SocketAddress localAddress() { return parent().localAddress(); }