mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2026-02-04 15:05:54 +08:00
【fix】注释udp、通道关闭验证通道关联通道是否存在
This commit is contained in:
@@ -15,7 +15,7 @@ import org.framework.lazy.cloud.network.heartbeat.server.properties.ServerNodePr
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
//@Component
|
||||
public class NettyUdpServerSocketApplicationListener implements SocketApplicationListener {
|
||||
|
||||
private final EventLoopGroup bossGroup = "linux".equalsIgnoreCase(SystemPropertyUtil.get("os.name")) ? new EpollEventLoopGroup() : new NioEventLoopGroup();
|
||||
|
||||
@@ -16,7 +16,8 @@ import org.springframework.context.annotation.Import;
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@Import({NettyTcpServerSocketApplicationListener.class, NettyUdpServerSocketApplicationListener.class})
|
||||
@Import({NettyTcpServerSocketApplicationListener.class})
|
||||
//@Import({NettyTcpServerSocketApplicationListener.class, NettyUdpServerSocketApplicationListener.class})
|
||||
public class InitServerSocket {
|
||||
|
||||
|
||||
|
||||
@@ -119,12 +119,16 @@ public class NettyTcpServerHandler extends SimpleChannelInboundHandler<NettyProx
|
||||
log.warn("client: {} channel:{}, disconnect with visitorId:{}", clientId, channel.id().toString(), visitorId);
|
||||
// 访客通道 关闭访客通道
|
||||
NettyCommunicationIdContext.clear(visitorId);
|
||||
// 关闭通信通道
|
||||
Channel nextChannel = ChannelAttributeKeyUtils.getNextChannel(channel);
|
||||
Channel transferNextChannel = ChannelAttributeKeyUtils.getTransferNextChannel(channel);
|
||||
// 关闭通信通道
|
||||
channel.close();
|
||||
if (ObjectUtils.isNotEmpty(nextChannel)) {
|
||||
nextChannel.close();
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(transferNextChannel)) {
|
||||
transferNextChannel.close();
|
||||
}
|
||||
super.channelInactive(ctx);
|
||||
} else if (!ObjectUtils.isEmpty(clientId)) {
|
||||
// 断开客户端的连接:{}
|
||||
|
||||
Reference in New Issue
Block a user