소스 검색

修复tcp可能无法获取到session的问题

zhou-hao 4 년 전
부모
커밋
9718d2aa5f

+ 1 - 0
jetlinks-components/network-component/tcp-component/src/main/java/org/jetlinks/community/network/tcp/device/TcpServerDeviceGateway.java

@@ -186,6 +186,7 @@ class TcpServerDeviceGateway implements DeviceGateway, MonitorSupportDeviceGatew
                                          .andThen(session -> {
                                              TcpDeviceSession deviceSession = session.unwrap(TcpDeviceSession.class);
                                              deviceSession.setClient(client);
+                                             sessionRef.set(deviceSession);
                                          }),
                                      () -> log.warn("无法从tcp[{}]消息中获取设备信息:{}", address, message)
                 )