@Override public int getConnectTimeout() throws Exception { return this.inner.getConnectTimeout(); }
synchronized void connect() { final Object lock = this; try { final int timeout = this.strategy.getConnectTimeout(); LOG.debug("Promise {} attempting connect for {}ms", lock, timeout); if(this.address.isUnresolved()) { this.address = new InetSocketAddress(this.address.getHostName(), this.address.getPort()); } this.b.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, timeout); final ChannelFuture connectFuture = this.b.connect(this.address); // Add listener that attempts reconnect by invoking this method again. connectFuture.addListener(new BootstrapConnectListener(lock)); this.pending = connectFuture; } catch (final Exception e) { LOG.info("Failed to connect to {}", address, e); setFailure(e); } }