Netconf client not reconnecting, when failed 1st time due
address unresolved. InetSocketAddress remains in state unresolved,
after connection failed first time due address unresolved.
Now recreating InetSocketAddress by each reconnect,
so address is checked by each reconnect attempt.
Change-Id: I29ef130d7bf3f65023a611cee51245a6ae6f9a03
Signed-off-by: Marian Dubai <mdubai@cisco.com>
final class ProtocolSessionPromise<S extends ProtocolSession<?>> extends DefaultPromise<S> {
private static final Logger LOG = LoggerFactory.getLogger(ProtocolSessionPromise.class);
private final ReconnectStrategy strategy;
final class ProtocolSessionPromise<S extends ProtocolSession<?>> extends DefaultPromise<S> {
private static final Logger LOG = LoggerFactory.getLogger(ProtocolSessionPromise.class);
private final ReconnectStrategy strategy;
- private final InetSocketAddress address;
+ private InetSocketAddress address;
private final Bootstrap b;
@GuardedBy("this")
private final Bootstrap b;
@GuardedBy("this")
LOG.debug("Promise {} attempting connect for {}ms", lock, timeout);
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.
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.