@Override public void onResponse(Void aVoid) { CloseableChannel.closeChannel(channel); }
/** * Closes the channel without blocking. * * @param channel to close */ static <C extends CloseableChannel> void closeChannel(C channel) { closeChannel(channel, false); }
@Override public void onFailure(Exception e) { logger.debug("failed to send message to httpOnTransport channel", e); CloseableChannel.closeChannel(channel); } };
public void onException(TcpChannel channel, Exception e) { if (!lifecycle.started()) { CloseableChannel.closeChannel(channel); return; "close connection exception caught on transport layer [{}], disconnecting from relevant node", channel), e); CloseableChannel.closeChannel(channel); } else if (isConnectException(e)) { logger.trace(() -> new ParameterizedMessage("connect exception caught on transport layer [{}]", channel), e); CloseableChannel.closeChannel(channel); } else if (e instanceof BindException) { logger.trace(() -> new ParameterizedMessage("bind exception caught on transport layer [{}]", channel), e); CloseableChannel.closeChannel(channel); } else if (e instanceof CancelledKeyException) { logger.trace(() -> new ParameterizedMessage( "cancelled key exception caught on transport layer [{}], disconnecting from relevant node", channel), e); CloseableChannel.closeChannel(channel); } else if (e instanceof TcpTransport.HttpOnTransportException) { logger.warn(() -> new ParameterizedMessage("exception caught on transport layer [{}], closing connection", channel), e); CloseableChannel.closeChannel(channel);