调整NettyServer启动时间
This commit is contained in:
parent
2acf6d2f7c
commit
ed1931cd98
|
@ -24,7 +24,7 @@ import java.util.Set;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("modbus-tcp")
|
@RequestMapping("modbus-tcp")
|
||||||
public class ModbusTCPController implements ApplicationRunner {
|
public class ModbusTCPController implements ApplicationRunner {
|
||||||
public static final NettyServer nettyServer = new NettyServer(502, Math.max(20, Runtime.getRuntime().availableProcessors() - 1));
|
public static NettyServer nettyServer;
|
||||||
|
|
||||||
@PreDestroy
|
@PreDestroy
|
||||||
private void destroy() {
|
private void destroy() {
|
||||||
|
@ -105,6 +105,7 @@ public class ModbusTCPController implements ApplicationRunner {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(ApplicationArguments args) throws Exception {
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
|
nettyServer = new NettyServer(502, Math.max(20, Runtime.getRuntime().availableProcessors() - 1));
|
||||||
nettyServer.start();
|
nettyServer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue