mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-06 13:27:55 +08:00
【fix】log
This commit is contained in:
parent
b1bd674ada
commit
80e5e4f628
@ -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");
|
||||||
// 恢复之前暂停的操作,如写入数据
|
// 恢复之前暂停的操作,如写入数据
|
||||||
|
@ -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) {
|
||||||
|
// 关闭 next、next transfer 通道
|
||||||
|
|
||||||
|
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(channel);
|
||||||
|
Channel transferNextChannel = ChannelAttributeKeyUtils.getTransferNextChannel(channel);
|
||||||
|
channel.close();
|
||||||
|
nextChannel.close();
|
||||||
|
transferNextChannel.close();
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user