去除日志;修改端口;调整网卡名字匹配

This commit is contained in:
chuzhongzai 2024-01-06 14:28:43 +08:00
parent 9a31a4593b
commit c17dfde4e2
4 changed files with 5 additions and 10 deletions

View File

@ -16,8 +16,6 @@ import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import io.netty.util.concurrent.DefaultPromise;
import io.netty.util.concurrent.Promise;
import jakarta.annotation.Resource;
@ -137,7 +135,7 @@ public class CommunicateToMainService {
protected void initChannel(NioSocketChannel channel) {
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(100000000, 4, 4));
channel.pipeline().addLast(new MessageCodec());
channel.pipeline().addLast(new LoggingHandler(LogLevel.INFO));
// channel.pipeline().addLast(new LoggingHandler(LogLevel.WARN));
channel.pipeline().addLast(new MyChannelInboundHandlerAdapter());
}
}).connect(ip, 7777).sync();
@ -160,7 +158,7 @@ public class CommunicateToMainService {
protected void initChannel(NioSocketChannel channel) {
channel.pipeline().addLast(new LengthFieldBasedFrameDecoder(100000000, 4, 4));
channel.pipeline().addLast(new MessageCodec());
channel.pipeline().addLast(new LoggingHandler(LogLevel.INFO));
// channel.pipeline().addLast(new LoggingHandler(LogLevel.WARN));
channel.pipeline().addLast(new MyChannelInboundHandlerAdapter());
}
}).connect(ip, 9999).sync();

View File

@ -11,8 +11,6 @@ import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -44,7 +42,7 @@ public class CommunicateToSiteService {
protected void initChannel(NioSocketChannel ch) {
ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(10000000, 4, 4));
ch.pipeline().addLast(new MessageCodec());
ch.pipeline().addLast(new LoggingHandler(LogLevel.INFO));
// ch.pipeline().addLast(new LoggingHandler(LogLevel.WARN));
ch.pipeline().addLast(new MyChannelInBoundHandlerAdapter());
}
}).bind(9999);

View File

@ -3,7 +3,6 @@ package com.lion.snss.util;
import cn.hutool.core.net.NetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import cn.hutool.system.SystemUtil;
import cn.hutool.system.oshi.CpuInfo;
import cn.hutool.system.oshi.OshiUtil;
import com.lion.snss.message.StatusMessage;
@ -62,7 +61,7 @@ public class IoUtil {
globalMemory = OshiUtil.getMemory();
for (NetworkIF nif : networkIFs)
if (nif.getName().startsWith("eth") || nif.getName().startsWith("ens")) {
if (nif.getName().startsWith("eth0") || nif.getName().startsWith("ens")) {
networkIF = nif;
break;
}

View File

@ -17,7 +17,7 @@ spring:
max-request-size: 10000MB
enabled: true
server:
port: 8080
port: 7777
error:
include-message: always