This commit is contained in:
Xujiayao 2025-11-07 19:07:21 +08:00
parent e17943ed45
commit ff275da25e
2 changed files with 2 additions and 2 deletions

View file

@ -52,7 +52,7 @@ public class NettyClient {
.channel(NioSocketChannel.class)
.handler(new ClientChannelInitializer(this));
LOGGER.info("Attempting to connect to server at " + host + ":" + port);
LOGGER.info("Attempting to connect to server at {}:{}", host, port);
ChannelFuture future = b.connect(host, port);
future.addListener((ChannelFutureListener) f -> {

View file

@ -44,7 +44,7 @@ public class ServerBusinessHandler extends SimpleChannelInboundHandler<Packet> {
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
if (evt instanceof IdleStateEvent e) {
if (e.state() == IdleState.READER_IDLE) {
LOGGER.warn("Did not receive heartbeat from client " + ctx.channel().remoteAddress() + ". Closing connection.");
LOGGER.warn("Did not receive heartbeat from client {}. Closing connection.", ctx.channel().remoteAddress());
ctx.close();
}
}