mirror of
https://gitee.com/wujiawei1207537021/wu-lazy-cloud-network.git
synced 2025-06-06 21:37:56 +08:00
【fix】 优化代理
This commit is contained in:
parent
d8a8b630ae
commit
e51ad201de
@ -34,9 +34,9 @@ public class NettyTcpProxySocketApplicationListener implements SocketApplication
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void doRunning() throws Exception {
|
public void doRunning() throws Exception {
|
||||||
try {
|
|
||||||
ProtocolProxyProperties.TcpProtocolProxy tcpProtocolProxy = protocolProxyProperties.getTcpProtocolProxy();
|
ProtocolProxyProperties.TcpProtocolProxy tcpProtocolProxy = protocolProxyProperties.getTcpProtocolProxy();
|
||||||
Integer tcpProtocolProxyPort = tcpProtocolProxy.getPort();
|
Integer tcpProtocolProxyPort = tcpProtocolProxy.getPort();
|
||||||
|
try {
|
||||||
ServerBootstrap b = new ServerBootstrap();
|
ServerBootstrap b = new ServerBootstrap();
|
||||||
b.group(bossGroup, workerGroup)
|
b.group(bossGroup, workerGroup)
|
||||||
.channel(NioServerSocketChannel.class)
|
.channel(NioServerSocketChannel.class)
|
||||||
@ -61,7 +61,7 @@ public class NettyTcpProxySocketApplicationListener implements SocketApplication
|
|||||||
});
|
});
|
||||||
channelFuture.channel().closeFuture().sync();
|
channelFuture.channel().closeFuture().sync();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("启动TCP 协议代理 失败", e);
|
log.error("启动TCP 协议代理 失败,端口:{}", tcpProtocolProxyPort, e);
|
||||||
} finally {
|
} finally {
|
||||||
destroy();
|
destroy();
|
||||||
// 服务器已关闭
|
// 服务器已关闭
|
||||||
|
@ -56,7 +56,7 @@ public class NettyTcpServerSocketApplicationListener implements SocketApplicatio
|
|||||||
|
|
||||||
channelFuture.addListener((ChannelFutureListener) channelFuture -> {
|
channelFuture.addListener((ChannelFutureListener) channelFuture -> {
|
||||||
// 服务器已启动
|
// 服务器已启动
|
||||||
log.info("TCP 服务器启动成功");
|
log.info("TCP 服务器启动成功【{}】",tcpPort);
|
||||||
});
|
});
|
||||||
channelFuture.channel().closeFuture().sync();
|
channelFuture.channel().closeFuture().sync();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user