|
|
@@ -27,6 +27,11 @@ import java.net.InetSocketAddress; |
|
|
|
@Slf4j |
|
|
|
public class DipperPositionServer { |
|
|
|
|
|
|
|
private String serverAddr="172.16.192.26"; |
|
|
|
private String timeAsycServerPort="9011"; |
|
|
|
private String posAsycServerPort="9013"; |
|
|
|
private String starsAsycServerPort="9012"; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
AsyncExecutorConfig positionConfig; |
|
|
|
/* |
|
|
@@ -34,14 +39,12 @@ public class DipperPositionServer { |
|
|
|
*/ |
|
|
|
public void startTimeAsnc() { |
|
|
|
|
|
|
|
log.debug("Server is :", positionConfig.getServerAddr()); |
|
|
|
log.debug("Port is :", positionConfig.getTimeAsycServerPort()); |
|
|
|
//new 一个主线程组 |
|
|
|
EventLoopGroup mainThreadGroup = new NioEventLoopGroup(1); |
|
|
|
//new 一个工作线程组 |
|
|
|
EventLoopGroup workThreadGroup = new NioEventLoopGroup(200); |
|
|
|
InetSocketAddress socketAddress = new InetSocketAddress(positionConfig.getServerAddr(), |
|
|
|
Integer.parseInt("9101")); |
|
|
|
InetSocketAddress socketAddress = new InetSocketAddress(serverAddr, |
|
|
|
Integer.parseInt(timeAsycServerPort)); |
|
|
|
ServerBootstrap bootstrap = new ServerBootstrap() |
|
|
|
.group(mainThreadGroup, workThreadGroup) |
|
|
|
.channel(NioServerSocketChannel.class) |
|
|
@@ -79,8 +82,8 @@ public class DipperPositionServer { |
|
|
|
EventLoopGroup mainThreadGroup = new NioEventLoopGroup(1); |
|
|
|
//new 一个工作线程组 |
|
|
|
EventLoopGroup workThreadGroup = new NioEventLoopGroup(200); |
|
|
|
InetSocketAddress socketAddress = new InetSocketAddress(positionConfig.getServerAddr(), |
|
|
|
Integer.parseInt(positionConfig.getPosAsycServerPort())); |
|
|
|
InetSocketAddress socketAddress = new InetSocketAddress(serverAddr, |
|
|
|
Integer.parseInt(posAsycServerPort)); |
|
|
|
ServerBootstrap bootstrap = new ServerBootstrap() |
|
|
|
.group(mainThreadGroup, workThreadGroup) |
|
|
|
.channel(NioServerSocketChannel.class) |
|
|
@@ -119,8 +122,8 @@ public class DipperPositionServer { |
|
|
|
EventLoopGroup mainThreadGroup = new NioEventLoopGroup(1); |
|
|
|
//new 一个工作线程组 |
|
|
|
EventLoopGroup workThreadGroup = new NioEventLoopGroup(200); |
|
|
|
InetSocketAddress socketAddress = new InetSocketAddress(positionConfig.getServerAddr(), |
|
|
|
Integer.parseInt(positionConfig.getStarsAsycServerPort())); |
|
|
|
InetSocketAddress socketAddress = new InetSocketAddress(serverAddr, |
|
|
|
Integer.parseInt(starsAsycServerPort)); |
|
|
|
ServerBootstrap bootstrap = new ServerBootstrap() |
|
|
|
.group(mainThreadGroup, workThreadGroup) |
|
|
|
.channel(NioServerSocketChannel.class) |
|
|
|