}, getKeepAliveTimerValue(), TimeUnit.SECONDS);
}
- LOG.info("Session {}[{}] <-> {}[{}] started", channel.localAddress(), localOpen.getSessionId(), channel.remoteAddress(),
+ LOG.info("Session {}[{}] <-> {}[{}] started", getLocalAddress(), localOpen.getSessionId(), getRemoteAddress(),
remoteOpen.getSessionId());
}
@Override
public InetAddress getRemoteAddress() {
+ if (this.channel.parent() != null) {
+ return ((InetSocketAddress) this.channel.localAddress()).getAddress();
+ }
return ((InetSocketAddress) this.channel.remoteAddress()).getAddress();
}
+ private InetAddress getLocalAddress() {
+ if (this.channel.parent() != null) {
+ return ((InetSocketAddress) this.channel.remoteAddress()).getAddress();
+ }
+ return ((InetSocketAddress) this.channel.localAddress()).getAddress();
+ }
+
private synchronized void terminate(final TerminationReason reason) {
LOG.info("Local PCEP session termination : {}", reason);
this.listener.onSessionTerminated(this, new PCEPCloseTermination(reason));
return future;
}
}).when(this.clientListener).writeAndFlush(any(Notification.class));
+ doReturn(null).when(this.clientListener).parent();
doReturn("TestingChannel").when(this.clientListener).toString();
doReturn(this.pipeline).when(this.clientListener).pipeline();
doReturn(this.address).when(this.clientListener).localAddress();
doReturn(ra).when(this.clientListener).remoteAddress();
final SocketAddress la = new InetSocketAddress("127.0.0.1", 30000);
doReturn(la).when(this.clientListener).localAddress();
+ doReturn(null).when(this.clientListener).parent();
doReturn(mock(ChannelFuture.class)).when(this.clientListener).close();