mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2026-02-04 15:05:54 +08:00
[fix] Handle
This commit is contained in:
@@ -3,7 +3,7 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
|
||||
import wu.framework.lazy.cloud.heartbeat.common.MessageType;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.AbstractChannelHeartbeatTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.AbstractHandleChannelHeartbeatTypeAdvanced;
|
||||
import io.netty.channel.Channel;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
* TYPE_HEARTBEAT
|
||||
*/
|
||||
@Component
|
||||
public class ClientChannelHeartbeatTypeAdvanced extends AbstractChannelHeartbeatTypeAdvanced<NettyProxyMsg> {
|
||||
public class ClientHandleChannelHeartbeatTypeAdvanced extends AbstractHandleChannelHeartbeatTypeAdvanced<NettyProxyMsg> {
|
||||
|
||||
/**
|
||||
* 处理当前数据
|
||||
@@ -4,14 +4,14 @@ import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeSingleClientMessageTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeSingleClientMessageTypeAdvanced;
|
||||
|
||||
/**
|
||||
* 接收服务端发送过来的聊天信息
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ClientDistributeSingleClientMessageTypeAdvanced extends AbstractDistributeSingleClientMessageTypeAdvanced<NettyProxyMsg> {
|
||||
public class ClientHandleDistributeSingleClientMessageTypeAdvanced extends AbstractHandleDistributeSingleClientMessageTypeAdvanced<NettyProxyMsg> {
|
||||
/**
|
||||
* 处理当前数据
|
||||
*
|
||||
@@ -2,7 +2,7 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyRealIdContext;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeSingleClientRealAutoReadConnectTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeSingleClientRealAutoReadConnectTypeAdvanced;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ClientDistributeSingleClientRealAutoReadConnectTypeAdvanced extends AbstractDistributeSingleClientRealAutoReadConnectTypeAdvanced<NettyProxyMsg> {
|
||||
public class ClientHandleDistributeSingleClientRealAutoReadConnectTypeAdvanced extends AbstractHandleDistributeSingleClientRealAutoReadConnectTypeAdvanced<NettyProxyMsg> {
|
||||
/**
|
||||
* 处理当前数据
|
||||
*
|
||||
@@ -3,14 +3,14 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyCommunicationIdContext;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyRealIdContext;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeSingleClientRealCloseVisitorTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeSingleClientRealCloseVisitorTypeAdvanced;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ClientDistributeSingleClientRealCloseVisitorTypeAdvanced extends AbstractDistributeSingleClientRealCloseVisitorTypeAdvanced<NettyProxyMsg> {
|
||||
public class ClientHandleDistributeSingleClientRealCloseVisitorTypeAdvanced extends AbstractHandleDistributeSingleClientRealCloseVisitorTypeAdvanced<NettyProxyMsg> {
|
||||
/**
|
||||
* 处理当前数据
|
||||
*
|
||||
@@ -4,8 +4,8 @@ import wu.framework.lazy.cloud.heartbeat.client.netty.config.NettyServerProperti
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.socket.NettyClientRealSocket;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.InternalNetworkPenetrationRealClient;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.ChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeSingleClientRealConnectTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.HandleChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeSingleClientRealConnectTypeAdvanced;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -17,14 +17,14 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ClientDistributeSingleClientRealConnectTypeAdvanced extends AbstractDistributeSingleClientRealConnectTypeAdvanced<NettyProxyMsg> {
|
||||
public class ClientHandleDistributeSingleClientRealConnectTypeAdvanced extends AbstractHandleDistributeSingleClientRealConnectTypeAdvanced<NettyProxyMsg> {
|
||||
|
||||
private final NettyServerProperties nettyServerProperties;// 服务端地址信息
|
||||
private final List<ChannelTypeAdvanced> channelTypeAdvancedList;
|
||||
private final List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList;
|
||||
|
||||
public ClientDistributeSingleClientRealConnectTypeAdvanced(NettyServerProperties nettyServerProperties, List<ChannelTypeAdvanced> channelTypeAdvancedList) {
|
||||
public ClientHandleDistributeSingleClientRealConnectTypeAdvanced(NettyServerProperties nettyServerProperties, List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList) {
|
||||
this.nettyServerProperties = nettyServerProperties;
|
||||
this.channelTypeAdvancedList = channelTypeAdvancedList;
|
||||
this.handleChannelTypeAdvancedList = handleChannelTypeAdvancedList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +50,7 @@ public class ClientDistributeSingleClientRealConnectTypeAdvanced extends Abstrac
|
||||
internalNetworkPenetrationRealClient.setVisitorId(visitorId);
|
||||
|
||||
// 绑定真实服务端口
|
||||
NettyClientRealSocket.buildRealServer(internalNetworkPenetrationRealClient,nettyServerProperties,channelTypeAdvancedList );
|
||||
NettyClientRealSocket.buildRealServer(internalNetworkPenetrationRealClient,nettyServerProperties, handleChannelTypeAdvancedList);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.config.NettyServerProperties;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyRealIdContext;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeChannelTransferTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeChannelTransferTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.enums.MessageTypeEnums;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.Channel;
|
||||
@@ -18,11 +18,11 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ClientReportChannelTransferTypeAdvanced extends AbstractDistributeChannelTransferTypeAdvanced<NettyProxyMsg> {
|
||||
public class ClientReportHandleChannelTransferTypeAdvancedHandleDistribute extends AbstractHandleDistributeChannelTransferTypeAdvanced<NettyProxyMsg> {
|
||||
|
||||
private final NettyServerProperties nettyServerProperties;
|
||||
|
||||
public ClientReportChannelTransferTypeAdvanced(NettyServerProperties nettyServerProperties) {
|
||||
public ClientReportHandleChannelTransferTypeAdvancedHandleDistribute(NettyServerProperties nettyServerProperties) {
|
||||
this.nettyServerProperties = nettyServerProperties;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.config.NettyServerProperties;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.ChannelContext;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeConnectSuccessNotificationTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeConnectSuccessNotificationTypeAdvancedHandle;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.utils.ChannelAttributeKeyUtils;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.application.ClientNettyConfigApplication;
|
||||
import io.netty.channel.Channel;
|
||||
@@ -19,12 +19,12 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DistributeConnectSuccessNotificationTypeAdvanced extends AbstractDistributeConnectSuccessNotificationTypeAdvanced <NettyProxyMsg>{
|
||||
public class HandleDistributeConnectSuccessNotificationTypeAdvancedHandle extends AbstractHandleDistributeConnectSuccessNotificationTypeAdvancedHandle<NettyProxyMsg> {
|
||||
|
||||
private final ClientNettyConfigApplication clientNettyConfigApplication;
|
||||
private final NettyServerProperties nettyServerProperties;
|
||||
|
||||
public DistributeConnectSuccessNotificationTypeAdvanced(ClientNettyConfigApplication clientNettyConfigApplication, NettyServerProperties nettyServerProperties) {
|
||||
public HandleDistributeConnectSuccessNotificationTypeAdvancedHandle(ClientNettyConfigApplication clientNettyConfigApplication, NettyServerProperties nettyServerProperties) {
|
||||
this.clientNettyConfigApplication = clientNettyConfigApplication;
|
||||
this.nettyServerProperties = nettyServerProperties;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
|
||||
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeDisconnectTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeDisconnectTypeAdvancedHandle;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.application.ClientNettyConfigApplication;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -15,12 +15,12 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DistributeDisconnectTypeAdvanced extends AbstractDistributeDisconnectTypeAdvanced <NettyProxyMsg> {
|
||||
public class HandleDistributeDisconnectTypeAdvancedHandle extends AbstractHandleDistributeDisconnectTypeAdvancedHandle<NettyProxyMsg> {
|
||||
|
||||
|
||||
private final ClientNettyConfigApplication clientNettyConfigApplication;
|
||||
|
||||
public DistributeDisconnectTypeAdvanced(ClientNettyConfigApplication clientNettyConfigApplication) {
|
||||
public HandleDistributeDisconnectTypeAdvancedHandle(ClientNettyConfigApplication clientNettyConfigApplication) {
|
||||
this.clientNettyConfigApplication = clientNettyConfigApplication;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeStagingClosedTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeStagingClosedTypeAdvanced;
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DistributeStagingClosedTypeAdvanced extends AbstractDistributeStagingClosedTypeAdvanced <NettyProxyMsg>{
|
||||
public class HandleDistributeStagingClosedTypeAdvanced extends AbstractHandleDistributeStagingClosedTypeAdvanced<NettyProxyMsg> {
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package wu.framework.lazy.cloud.heartbeat.client.netty.advanced;
|
||||
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractDistributeStagingOpenedTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.client.AbstractHandleDistributeStagingOpenedTypeAdvanced;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -12,11 +12,11 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DistributeStagingOpenedTypeAdvanced extends AbstractDistributeStagingOpenedTypeAdvanced<NettyProxyMsg>{
|
||||
public class HandleDistributeStagingOpenedTypeAdvanced extends AbstractHandleDistributeStagingOpenedTypeAdvanced<NettyProxyMsg> {
|
||||
|
||||
|
||||
|
||||
public DistributeStagingOpenedTypeAdvanced() {
|
||||
public HandleDistributeStagingOpenedTypeAdvanced() {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package wu.framework.lazy.cloud.heartbeat.client.netty.config;
|
||||
|
||||
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.ChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.HandleChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.application.ClientNettyConfigApplication;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.socket.NettyClientSocket;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -27,7 +27,7 @@ public class ClientAutoConfiguration implements CommandLineRunner {
|
||||
private final NettyServerProperties nettyServerProperties;
|
||||
private final ClientNettyConfigApplication clientNettyConfigApplication;
|
||||
|
||||
private final List<ChannelTypeAdvanced> channelTypeAdvancedList; // 处理服务端发送过来的数据类型
|
||||
private final List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList; // 处理服务端发送过来的数据类型
|
||||
|
||||
|
||||
ThreadPoolExecutor NETTY_CLIENT_EXECUTOR = new ThreadPoolExecutor(1, 1, 200, TimeUnit.MILLISECONDS,
|
||||
@@ -35,10 +35,10 @@ public class ClientAutoConfiguration implements CommandLineRunner {
|
||||
|
||||
public ClientAutoConfiguration(NettyServerProperties nettyServerProperties,
|
||||
ClientNettyConfigApplication clientNettyConfigApplication,
|
||||
List<ChannelTypeAdvanced> channelTypeAdvancedList) {
|
||||
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList) {
|
||||
this.nettyServerProperties = nettyServerProperties;
|
||||
this.clientNettyConfigApplication = clientNettyConfigApplication;
|
||||
this.channelTypeAdvancedList = channelTypeAdvancedList;
|
||||
this.handleChannelTypeAdvancedList = handleChannelTypeAdvancedList;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ClientAutoConfiguration implements CommandLineRunner {
|
||||
String inetHost = nettyServerProperties.getInetHost();
|
||||
int inetPort = nettyServerProperties.getInetPort();
|
||||
String clientId = nettyServerProperties.getClientId();
|
||||
return new NettyClientSocket(inetHost, inetPort, clientId, clientNettyConfigApplication, channelTypeAdvancedList);
|
||||
return new NettyClientSocket(inetHost, inetPort, clientId, clientNettyConfigApplication, handleChannelTypeAdvancedList);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,7 +61,7 @@ public class ClientAutoConfiguration implements CommandLineRunner {
|
||||
String inetHost = nettyServerProperties.getInetHost();
|
||||
int inetPort = nettyServerProperties.getInetPort();
|
||||
String clientId = nettyServerProperties.getClientId();
|
||||
NettyClientSocket nettyClientSocket = new NettyClientSocket(inetHost, inetPort, clientId, clientNettyConfigApplication, channelTypeAdvancedList);
|
||||
NettyClientSocket nettyClientSocket = new NettyClientSocket(inetHost, inetPort, clientId, clientNettyConfigApplication, handleChannelTypeAdvancedList);
|
||||
Thread thread = new Thread(() -> {
|
||||
try {
|
||||
nettyClientSocket.newConnect2Server();
|
||||
|
||||
@@ -6,8 +6,7 @@ import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Role;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.application.ClientNettyConfigApplication;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.advanced.*;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.config.NettyServerProperties;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.ChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.HandleChannelTypeAdvanced;
|
||||
|
||||
import java.util.List;
|
||||
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
|
||||
@@ -16,59 +15,59 @@ public class HeartbeatClientConfiguration {
|
||||
/**
|
||||
* 服务端 处理客户端心跳
|
||||
*
|
||||
* @return ClientChannelHeartbeatTypeAdvanced
|
||||
* @return ClientHandleChannelHeartbeatTypeAdvanced
|
||||
*/
|
||||
@Bean
|
||||
public ClientChannelHeartbeatTypeAdvanced clientChannelHeartbeatTypeAdvanced() {
|
||||
return new ClientChannelHeartbeatTypeAdvanced();
|
||||
public ClientHandleChannelHeartbeatTypeAdvanced clientChannelHeartbeatTypeAdvanced() {
|
||||
return new ClientHandleChannelHeartbeatTypeAdvanced();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理 客户端代理的真实端口自动读写
|
||||
* @return ClientDistributeSingleClientRealAutoReadConnectTypeAdvanced
|
||||
* @return ClientHandleDistributeSingleClientRealAutoReadConnectTypeAdvanced
|
||||
*/
|
||||
@Bean
|
||||
public ClientDistributeSingleClientRealAutoReadConnectTypeAdvanced clientDistributeSingleClientRealAutoReadConnectTypeAdvanced(){
|
||||
return new ClientDistributeSingleClientRealAutoReadConnectTypeAdvanced();
|
||||
public ClientHandleDistributeSingleClientRealAutoReadConnectTypeAdvanced clientDistributeSingleClientRealAutoReadConnectTypeAdvanced(){
|
||||
return new ClientHandleDistributeSingleClientRealAutoReadConnectTypeAdvanced();
|
||||
}
|
||||
/**
|
||||
* 处理 接收服务端发送过来的聊天信息
|
||||
* @return ClientDistributeSingleClientMessageTypeAdvanced
|
||||
* @return ClientHandleDistributeSingleClientMessageTypeAdvanced
|
||||
*/
|
||||
@Bean
|
||||
public ClientDistributeSingleClientMessageTypeAdvanced clientDistributeSingleClientMessageTypeAdvanced(){
|
||||
return new ClientDistributeSingleClientMessageTypeAdvanced();
|
||||
public ClientHandleDistributeSingleClientMessageTypeAdvanced clientDistributeSingleClientMessageTypeAdvanced(){
|
||||
return new ClientHandleDistributeSingleClientMessageTypeAdvanced();
|
||||
}
|
||||
@Bean
|
||||
public ClientDistributeSingleClientRealCloseVisitorTypeAdvanced clientDistributeSingleClientRealCloseVisitorTypeAdvanced(){
|
||||
return new ClientDistributeSingleClientRealCloseVisitorTypeAdvanced();
|
||||
public ClientHandleDistributeSingleClientRealCloseVisitorTypeAdvanced clientDistributeSingleClientRealCloseVisitorTypeAdvanced(){
|
||||
return new ClientHandleDistributeSingleClientRealCloseVisitorTypeAdvanced();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ClientReportChannelTransferTypeAdvanced clientReportChannelTransferTypeAdvanced(NettyServerProperties nettyServerProperties){
|
||||
return new ClientReportChannelTransferTypeAdvanced(nettyServerProperties);
|
||||
public ClientReportHandleChannelTransferTypeAdvancedHandleDistribute clientReportChannelTransferTypeAdvanced(NettyServerProperties nettyServerProperties){
|
||||
return new ClientReportHandleChannelTransferTypeAdvancedHandleDistribute(nettyServerProperties);
|
||||
}
|
||||
@Bean
|
||||
public DistributeConnectSuccessNotificationTypeAdvanced distributeConnectSuccessNotificationTypeAdvanced(ClientNettyConfigApplication clientNettyConfigApplication, NettyServerProperties nettyServerProperties){
|
||||
return new DistributeConnectSuccessNotificationTypeAdvanced(clientNettyConfigApplication, nettyServerProperties);
|
||||
public HandleDistributeConnectSuccessNotificationTypeAdvancedHandle distributeConnectSuccessNotificationTypeAdvanced(ClientNettyConfigApplication clientNettyConfigApplication, NettyServerProperties nettyServerProperties){
|
||||
return new HandleDistributeConnectSuccessNotificationTypeAdvancedHandle(clientNettyConfigApplication, nettyServerProperties);
|
||||
}
|
||||
@Bean
|
||||
public DistributeDisconnectTypeAdvanced distributeDisconnectTypeAdvanced(ClientNettyConfigApplication clientNettyConfigApplication){
|
||||
return new DistributeDisconnectTypeAdvanced(clientNettyConfigApplication);
|
||||
public HandleDistributeDisconnectTypeAdvancedHandle distributeDisconnectTypeAdvanced(ClientNettyConfigApplication clientNettyConfigApplication){
|
||||
return new HandleDistributeDisconnectTypeAdvancedHandle(clientNettyConfigApplication);
|
||||
}
|
||||
@Bean
|
||||
public DistributeStagingClosedTypeAdvanced distributeStagingClosedTypeAdvanced(){
|
||||
return new DistributeStagingClosedTypeAdvanced();
|
||||
public HandleDistributeStagingClosedTypeAdvanced distributeStagingClosedTypeAdvanced(){
|
||||
return new HandleDistributeStagingClosedTypeAdvanced();
|
||||
}
|
||||
@Bean
|
||||
public DistributeStagingOpenedTypeAdvanced distributeStagingOpenedTypeAdvanced(){
|
||||
return new DistributeStagingOpenedTypeAdvanced();
|
||||
public HandleDistributeStagingOpenedTypeAdvanced distributeStagingOpenedTypeAdvanced(){
|
||||
return new HandleDistributeStagingOpenedTypeAdvanced();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public ClientDistributeSingleClientRealConnectTypeAdvanced clientDistributeSingleClientRealConnectTypeAdvanced(NettyServerProperties nettyServerProperties,
|
||||
List<ChannelTypeAdvanced> channelTypeAdvancedList ){
|
||||
return new ClientDistributeSingleClientRealConnectTypeAdvanced(nettyServerProperties,channelTypeAdvancedList);
|
||||
public ClientHandleDistributeSingleClientRealConnectTypeAdvanced clientDistributeSingleClientRealConnectTypeAdvanced(NettyServerProperties nettyServerProperties,
|
||||
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList){
|
||||
return new ClientHandleDistributeSingleClientRealConnectTypeAdvanced(nettyServerProperties, handleChannelTypeAdvancedList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.socket;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.config.NettyServerProperties;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.*;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.adapter.ChannelTypeAdapter;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.ChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.HandleChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.utils.ChannelAttributeKeyUtils;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.filter.NettyClientRealFilter;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.filter.NettyClientVisitorRealFilter;
|
||||
@@ -32,9 +32,9 @@ public class NettyClientRealSocket {
|
||||
*/
|
||||
public static void buildRealServer(InternalNetworkPenetrationRealClient internalNetworkPenetrationRealClient,
|
||||
NettyServerProperties nettyServerProperties,
|
||||
List<ChannelTypeAdvanced> channelTypeAdvancedList) {
|
||||
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList) {
|
||||
|
||||
buildNewRealServer(internalNetworkPenetrationRealClient, nettyServerProperties, channelTypeAdvancedList);
|
||||
buildNewRealServer(internalNetworkPenetrationRealClient, nettyServerProperties, handleChannelTypeAdvancedList);
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class NettyClientRealSocket {
|
||||
*/
|
||||
private static void buildNewRealServer(InternalNetworkPenetrationRealClient internalNetworkPenetrationRealClient,
|
||||
NettyServerProperties nettyServerProperties,
|
||||
List<ChannelTypeAdvanced> channelTypeAdvancedList) {
|
||||
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList) {
|
||||
try {
|
||||
String clientTargetIp = internalNetworkPenetrationRealClient.getClientTargetIp();
|
||||
Integer clientTargetPort = internalNetworkPenetrationRealClient.getClientTargetPort();
|
||||
@@ -71,7 +71,7 @@ public class NettyClientRealSocket {
|
||||
|
||||
|
||||
// 新建一个通道处理
|
||||
newVisitorConnect2Server(internalNetworkPenetrationRealClient, nettyServerProperties, channelTypeAdvancedList);
|
||||
newVisitorConnect2Server(internalNetworkPenetrationRealClient, nettyServerProperties, handleChannelTypeAdvancedList);
|
||||
|
||||
// 是否等 服务端相应访客通道已经可以自动读写
|
||||
// realChannel.config().setOption(ChannelOption.AUTO_READ, true);
|
||||
@@ -112,16 +112,16 @@ public class NettyClientRealSocket {
|
||||
*
|
||||
* @param internalNetworkPenetrationRealClient 内网穿透信息
|
||||
* @param nettyServerProperties 服务端配置信息
|
||||
* @param channelTypeAdvancedList 处理器适配器
|
||||
* @param handleChannelTypeAdvancedList 处理器适配器
|
||||
* @throws InterruptedException 异常
|
||||
*/
|
||||
protected static void newVisitorConnect2Server(InternalNetworkPenetrationRealClient internalNetworkPenetrationRealClient,
|
||||
NettyServerProperties nettyServerProperties,
|
||||
List<ChannelTypeAdvanced> channelTypeAdvancedList) throws InterruptedException {
|
||||
List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList) throws InterruptedException {
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
bootstrap.group(eventLoopGroup)
|
||||
.channel(NioSocketChannel.class)
|
||||
.handler(new NettyClientVisitorRealFilter(new ChannelTypeAdapter(channelTypeAdvancedList)))
|
||||
.handler(new NettyClientVisitorRealFilter(new ChannelTypeAdapter(handleChannelTypeAdvancedList)))
|
||||
;
|
||||
|
||||
String inetHost = nettyServerProperties.getInetHost();
|
||||
@@ -165,7 +165,7 @@ public class NettyClientRealSocket {
|
||||
// 离线
|
||||
channel.eventLoop().schedule(() -> {
|
||||
try {
|
||||
newVisitorConnect2Server(internalNetworkPenetrationRealClient, nettyServerProperties, channelTypeAdvancedList);
|
||||
newVisitorConnect2Server(internalNetworkPenetrationRealClient, nettyServerProperties, handleChannelTypeAdvancedList);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package wu.framework.lazy.cloud.heartbeat.client.netty.socket;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.MessageType;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.NettyProxyMsg;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.adapter.ChannelTypeAdapter;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.ChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.advanced.HandleChannelTypeAdvanced;
|
||||
import wu.framework.lazy.cloud.heartbeat.common.utils.ChannelAttributeKeyUtils;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.application.ClientNettyConfigApplication;
|
||||
import wu.framework.lazy.cloud.heartbeat.client.netty.filter.NettyClientFilter;
|
||||
@@ -45,16 +45,16 @@ public class NettyClientSocket {
|
||||
@Getter
|
||||
private final ClientNettyConfigApplication clientNettyConfigApplication;
|
||||
|
||||
private final List<ChannelTypeAdvanced> channelTypeAdvancedList; // 处理服务端发送过来的数据类型
|
||||
private final List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList; // 处理服务端发送过来的数据类型
|
||||
|
||||
private static final EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
|
||||
|
||||
public NettyClientSocket(String inetHost, int inetPort, String clientId, ClientNettyConfigApplication clientNettyConfigApplication, List<ChannelTypeAdvanced> channelTypeAdvancedList) {
|
||||
public NettyClientSocket(String inetHost, int inetPort, String clientId, ClientNettyConfigApplication clientNettyConfigApplication, List<HandleChannelTypeAdvanced> handleChannelTypeAdvancedList) {
|
||||
this.inetHost = inetHost;
|
||||
this.inetPort = inetPort;
|
||||
this.clientId = clientId;
|
||||
this.clientNettyConfigApplication = clientNettyConfigApplication;
|
||||
this.channelTypeAdvancedList = channelTypeAdvancedList;
|
||||
this.handleChannelTypeAdvancedList = handleChannelTypeAdvancedList;
|
||||
}
|
||||
|
||||
public void newConnect2Server() throws InterruptedException {
|
||||
@@ -65,7 +65,7 @@ public class NettyClientSocket {
|
||||
Bootstrap bootstrap = new Bootstrap();
|
||||
bootstrap.group(eventLoopGroup)
|
||||
.channel(NioSocketChannel.class)
|
||||
.handler(new NettyClientFilter(new ChannelTypeAdapter(channelTypeAdvancedList),this))
|
||||
.handler(new NettyClientFilter(new ChannelTypeAdapter(handleChannelTypeAdvancedList),this))
|
||||
;
|
||||
|
||||
log.info("连接服务端IP:{},连接服务端端口:{}", inetHost, inetPort);
|
||||
|
||||
Reference in New Issue
Block a user