【fix】log

This commit is contained in:
wujiawei 2024-09-21 02:03:16 +08:00
parent b1bd674ada
commit 80e5e4f628
2 changed files with 37 additions and 12 deletions

View File

@ -102,8 +102,7 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
// 通知客户端 关闭访问通道真实通道 // 通知客户端 关闭访问通道真实通道
NettyProxyMsg myMsg = new NettyProxyMsg(); NettyProxyMsg myMsg = new NettyProxyMsg();
myMsg.setType(MessageType.DISTRIBUTE_SINGLE_CLIENT_REAL_CLOSE_VISITOR); myMsg.setType(MessageType.REPORT_CLIENT_PERMEATE_CLIENT_CLOSE);
myMsg.setVisitorId(visitorId);
nextChannel.writeAndFlush(myMsg); nextChannel.writeAndFlush(myMsg);
} }
// 关闭 访客通信通道访客真实通道 // 关闭 访客通信通道访客真实通道
@ -128,16 +127,6 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
log.debug("visitorId:{} transfer AUTO_READ:{} ",visitorId,ctx.channel().isWritable()); log.debug("visitorId:{} transfer AUTO_READ:{} ",visitorId,ctx.channel().isWritable());
visitorCommunicationChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable()); visitorCommunicationChannel.config().setOption(ChannelOption.AUTO_READ, ctx.channel().isWritable());
} }
// Channel visitorChannel = ctx.channel();
// String vid = visitorChannel.attr(Constant.VID).get();
// if (StringUtil.isNullOrEmpty(vid)) {
// super.channelWritabilityChanged(ctx);
// return;
// }
// Channel clientChannel = Constant.vcc.get(vid);
// if (clientChannel != null) {
// clientChannel.config().setOption(ChannelOption.AUTO_READ, visitorChannel.isWritable());
// }
if (ctx.channel().isWritable()) { if (ctx.channel().isWritable()) {
log.debug("Channel is writable again"); log.debug("Channel is writable again");
// 恢复之前暂停的操作如写入数据 // 恢复之前暂停的操作如写入数据

View File

@ -0,0 +1,36 @@
package org.framework.lazy.cloud.network.heartbeat.server.netty.advanced;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.framework.lazy.cloud.network.heartbeat.common.NettyCommunicationIdContext;
import org.framework.lazy.cloud.network.heartbeat.common.NettyProxyMsg;
import org.framework.lazy.cloud.network.heartbeat.common.NettyRealIdContext;
import org.framework.lazy.cloud.network.heartbeat.common.advanced.server.AbstractHandleReportClientPermeateClientCloseTypeAdvanced;
import org.framework.lazy.cloud.network.heartbeat.common.utils.ChannelAttributeKeyUtils;
import org.springframework.stereotype.Component;
/**
* 上报 客户端渗透客户端init close 信息
*/
@Slf4j
@Component
public class ServerHandleReportClientPermeateClientCloseTypeAdvanced extends AbstractHandleReportClientPermeateClientCloseTypeAdvanced<NettyProxyMsg> {
/**
* 处理当前数据
*
* @param channel 当前通道
* @param nettyProxyMsg 通道数据
*/
@Override
protected void doHandler(Channel channel, NettyProxyMsg nettyProxyMsg) {
// 关闭 nextnext transfer 通道
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(channel);
Channel transferNextChannel = ChannelAttributeKeyUtils.getTransferNextChannel(channel);
channel.close();
nextChannel.close();
transferNextChannel.close();
}
}