if (this.channel != null) {
ChannelFuture future = this.channel.close();
NettyOperationListener operationListener = new NettyOperationListener();
future.addListener(operationListener);
try {
operationListener.awaitUninterruptibly(Constants.TECH_LEVEL_OPERATION_TIMEOUT_MILLIS);
} catch (CommunicationException ex) {
LOGGER.error("disconnect", ex); // stopListening must continue
}
}
if (this.serverThread != null) {