Explorar el Código

netty 项目启动 监听启动

donggaosheng hace 3 años
padre
commit
5a41b07ca4

+ 4 - 0
zd-modules/zd-netty/src/main/java/com/zd/netty/init/NettyStartListener.java

@@ -7,6 +7,7 @@ import com.zd.netty.service.IFridService;
 import com.zd.system.api.laboratory.RemoteLaboratoryService;
 import com.zd.system.api.laboratory.domain.RemoteLabHardware;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.ApplicationArguments;
 import org.springframework.boot.ApplicationRunner;
 import org.springframework.stereotype.Component;
@@ -27,9 +28,12 @@ public class NettyStartListener implements ApplicationRunner {
     private IFridService fridService;
     @Resource
     private RemoteLaboratoryService laboratoryService;
+    @Autowired
+    private  SocketServer socketServer;
 
     @Override
     public void run(ApplicationArguments args) {
+        socketServer.start();
         new Thread(new Runnable() {
             @Override
             public void run() {