@@ -47,19 +47,9 @@ public class DipperPositionApplication { | |||
PositionConfigInfo pci; | |||
pci = (PositionConfigInfo)environment.getSystemProperties().get("position-server"); | |||
DipperPositionServer nettyServer2 = new DipperPositionServer(pci); | |||
nettyServer2.start(); | |||
} catch (Exception e) { | |||
log.error(e.getMessage()); | |||
} | |||
} | |||
private static void test() throws NacosException { | |||
String serverAddr = "172.16.192.26"; | |||
String dataId = "dipperposition-service"; | |||
String group = "DEFAULT_GROUP"; | |||
Properties properties = new Properties(); | |||
properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr); | |||
ConfigService configService = NacosFactory.createConfigService(properties); | |||
String content = configService.getConfig(dataId, group, 5000); | |||
System.out.println(content); | |||
} | |||
} |
@@ -14,6 +14,8 @@ import io.netty.channel.nio.NioEventLoopGroup; | |||
import io.netty.channel.socket.nio.NioServerSocketChannel; | |||
import lombok.extern.slf4j.Slf4j; | |||
import java.net.InetSocketAddress; | |||
/** | |||
* @program: DipperPositionServer | |||
* @description: 北斗定位 | |||
@@ -153,8 +155,7 @@ public class DipperPositionServer { | |||
EventLoopGroup mainThreadGroup = new NioEventLoopGroup(1); | |||
//new 一个工作线程组 | |||
EventLoopGroup workThreadGroup = new NioEventLoopGroup(200); | |||
//InetSocketAddress socketAddress = new InetSocketAddress(serverAddr, | |||
// starsAsycPort); | |||
//InetSocketAddress socketAddress = new InetSocketAddress(serverAddr,null); | |||
ServerBootstrap bootstrap = new ServerBootstrap() | |||
.group(mainThreadGroup, workThreadGroup) | |||
.channel(NioServerSocketChannel.class) | |||