feat: 修复跨服传送时的错误
This commit is contained in:
@@ -58,7 +58,7 @@ public class BallServerChannelInitializer extends ChannelInitializer<SocketChann
|
||||
}
|
||||
|
||||
channel.pipeline()
|
||||
.addLast(new IdleStateHandler(10, 0, 0, TimeUnit.SECONDS))
|
||||
.addLast(new IdleStateHandler(60, 0, 0, TimeUnit.SECONDS))
|
||||
.addLast(new BallServerKeepAliveHandler())
|
||||
.addLast(new LengthFieldPrepender(8))
|
||||
.addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0, 8, 0, 8))
|
||||
|
@@ -13,10 +13,10 @@ public class BallServerKeepAliveHandler extends SimpleUserEventChannelHandler<Id
|
||||
|
||||
@Override
|
||||
protected void eventReceived(ChannelHandlerContext context, IdleStateEvent event) {
|
||||
context.close();
|
||||
synchronized (BallServerChannelInitializer.CHANNELS) {
|
||||
BallServerChannelInitializer.CHANNELS.remove(context.channel());
|
||||
}
|
||||
context.close();
|
||||
LOGGER.warn("由于无法验证连接存活,与服务器 {} 的连接已断开.", context.channel().remoteAddress());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user