Browse Source

20240215: VmsTcpCommServerService code refectoring

shjung 1 year ago
parent
commit
a95648fbef

+ 3 - 4
src/main/java/com/its/vms/xnettcp/vms/VmsTcpCommServerService.java

@@ -31,7 +31,6 @@ public class VmsTcpCommServerService {
 
     private EventLoopGroup acceptGroups = null;
     private EventLoopGroup workerGroups = null;
-    private ServerBootstrap serverBootstrap = null;
     private ChannelFuture channelFuture = null;
 
     public void run() {
@@ -46,7 +45,7 @@ public class VmsTcpCommServerService {
             log.info("서버가 윈도우 NIO 모드에서 실행됩니다.");
         }
 
-        this.serverBootstrap = createBootstrap();
+        ServerBootstrap serverBootstrap = createBootstrap();
 
         log.info("*********************************************************************************");
         log.info("**                    VMS Communication Server Information                    **");
@@ -59,10 +58,10 @@ public class VmsTcpCommServerService {
 
         try {
             if (this.config.getBindingAddr().equals("0.0.0.0")) {
-                this.channelFuture = this.serverBootstrap.bind(this.config.getListenPort());
+                this.channelFuture = serverBootstrap.bind(this.config.getListenPort());
             }
             else {
-                this.channelFuture = this.serverBootstrap.bind(this.config.getBindingAddr(), config.getListenPort());
+                this.channelFuture = serverBootstrap.bind(this.config.getBindingAddr(), config.getListenPort());
             }
         }
         catch (Exception e) {