【fix】修复流量计费bug

This commit is contained in:
wujiawei 2024-09-22 15:49:16 +08:00
parent a5a832aa1d
commit 4f58a675d0
3 changed files with 5 additions and 5 deletions

View File

@ -75,9 +75,11 @@ public class NettyClientPermeateClientVisitorHandler extends SimpleChannelInboun
// 使用访客的通信通道 // 使用访客的通信通道
Integer visitorPort = internalNetworkClientPermeateClientVisitor.getVisitorPort(); Integer visitorPort = internalNetworkClientPermeateClientVisitor.getVisitorPort();
String clientId = internalNetworkClientPermeateClientVisitor.getNettyClientProperties().getClientId();
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg(); NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(MessageType.REPORT_CLIENT_TRANSFER_CLIENT_REQUEST); nettyProxyMsg.setType(MessageType.REPORT_CLIENT_TRANSFER_CLIENT_REQUEST);
nettyProxyMsg.setVisitorId(visitorId); nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setVisitorPort(visitorPort); nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setData(bytes); nettyProxyMsg.setData(bytes);
nextChannel.writeAndFlush(nettyProxyMsg); nextChannel.writeAndFlush(nettyProxyMsg);

View File

@ -74,9 +74,11 @@ public class NettyClientPermeateServerVisitorHandler extends SimpleChannelInboun
// 使用访客的通信通道 // 使用访客的通信通道
Integer visitorPort = internalNetworkPermeateServerVisitor.getVisitorPort(); Integer visitorPort = internalNetworkPermeateServerVisitor.getVisitorPort();
String clientId = internalNetworkPermeateServerVisitor.getNettyClientProperties().getClientId();
NettyProxyMsg nettyProxyMsg = new NettyProxyMsg(); NettyProxyMsg nettyProxyMsg = new NettyProxyMsg();
nettyProxyMsg.setType(MessageType.REPORT_CLIENT_TRANSFER); nettyProxyMsg.setType(MessageType.REPORT_CLIENT_TRANSFER);
nettyProxyMsg.setVisitorId(visitorId); nettyProxyMsg.setVisitorId(visitorId);
nettyProxyMsg.setClientId(clientId);
nettyProxyMsg.setVisitorPort(visitorPort); nettyProxyMsg.setVisitorPort(visitorPort);
nettyProxyMsg.setData(bytes); nettyProxyMsg.setData(bytes);
nextChannel.writeAndFlush(nettyProxyMsg); nextChannel.writeAndFlush(nettyProxyMsg);

View File

@ -101,11 +101,7 @@ public class NettyClientPermeateServerVisitorTransferSocket {
} else { } else {
log.info("每隔2s重连...."); log.info("客户端渗透服务端通信通道中断....");
// 离线
channel.eventLoop().schedule(() -> {
newTransferConnect2Server(internalNetworkPermeateServerVisitor);
}, 2, TimeUnit.SECONDS);
} }
}); });
} }