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