mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-07 22:07:55 +08:00
fix 服务端添加心跳监听
This commit is contained in:
parent
cbd0d7c954
commit
cfb0adfc89
@ -27,6 +27,7 @@ public class NettyProxyAutoConfiguration {
|
|||||||
Constant.serverIp = clientProxyConfigurationProperties.getServerIp();
|
Constant.serverIp = clientProxyConfigurationProperties.getServerIp();
|
||||||
Constant.serverPort = clientProxyConfigurationProperties.getServerPort();
|
Constant.serverPort = clientProxyConfigurationProperties.getServerPort();
|
||||||
Constant.realPort = serverProperties.getPort();
|
Constant.realPort = serverProperties.getPort();
|
||||||
|
Constant.realPort = 28080;
|
||||||
|
|
||||||
|
|
||||||
log.info("netty客户端连接服务端IP:{},服务端端口:{},客户端自己的端口:{}",Constant.serverIp,Constant.serverPort,Constant.realPort);
|
log.info("netty客户端连接服务端IP:{},服务端端口:{},客户端自己的端口:{}",Constant.serverIp,Constant.serverPort,Constant.realPort);
|
||||||
|
@ -4,7 +4,6 @@ import com.lazy.netty.proxy.msg.MyMsgDecoder;
|
|||||||
import com.lazy.netty.proxy.msg.MyMsgEncoder;
|
import com.lazy.netty.proxy.msg.MyMsgEncoder;
|
||||||
import com.lazy.netty.proxy.server.handler.ClientHandler;
|
import com.lazy.netty.proxy.server.handler.ClientHandler;
|
||||||
import com.lazy.netty.proxy.server.handler.HeartBeatServerHandler;
|
import com.lazy.netty.proxy.server.handler.HeartBeatServerHandler;
|
||||||
import com.lazy.netty.proxy.server.handler.LazyServerIdleStateHandler;
|
|
||||||
import io.netty.bootstrap.ServerBootstrap;
|
import io.netty.bootstrap.ServerBootstrap;
|
||||||
import io.netty.channel.*;
|
import io.netty.channel.*;
|
||||||
import io.netty.channel.nio.NioEventLoopGroup;
|
import io.netty.channel.nio.NioEventLoopGroup;
|
||||||
@ -34,7 +33,7 @@ public class ServerSocket {
|
|||||||
pipeline.addLast(new MyMsgDecoder(Integer.MAX_VALUE, 0, 4, -4, 0));
|
pipeline.addLast(new MyMsgDecoder(Integer.MAX_VALUE, 0, 4, -4, 0));
|
||||||
pipeline.addLast(new MyMsgEncoder());
|
pipeline.addLast(new MyMsgEncoder());
|
||||||
pipeline.addLast(new IdleStateHandler(40, 10, 0));
|
pipeline.addLast(new IdleStateHandler(40, 10, 0));
|
||||||
pipeline.addLast(new LazyServerIdleStateHandler(40, 10, 0));
|
// pipeline.addLast(new LazyServerIdleStateHandler(40, 10, 0));
|
||||||
pipeline.addLast(new ClientHandler());
|
pipeline.addLast(new ClientHandler());
|
||||||
pipeline.addLast(new HeartBeatServerHandler());
|
pipeline.addLast(new HeartBeatServerHandler());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user