negotiationFutureListener = future -> {
if (future.isSuccess()) {
- connectPromise.setSuccess();
+ channelPromise.setSuccess();
}
};
//complete connection promise with netconf negotiation future
negotiationFuture.addListener(negotiationFutureListener);
} else {
- connectPromise.setFailure(future.cause());
+ channelPromise.setFailure(future.cause());
}
});
ctx.connect(remoteAddress, localAddress, tcpConnectFuture);
@Override
public void disconnect(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception {
+ if (connectPromise == null) {
+ return;
+ }
+
// If we have already succeeded and the session was dropped after, we need to fire inactive to notify
// reconnect logic
if (connectPromise.isSuccess()) {