100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Gateways: Disconnect and destroy all active tunnel sessions when closing a `GatewayClientConnector` (#2497)
Panos Kalogeropoulosd1bcf62c6ea6
diff --git a/manager/src/main/java/org/openremote/manager/gateway/GatewayClientConnector.java b/manager/src/main/java/org/openremote/manager/gateway/GatewayClientConnector.javaindex 0f2c41e3d..fe66ad1a5 100644--- a/manager/src/main/java/org/openremote/manager/gateway/GatewayClientConnector.java+++ b/manager/src/main/java/org/openremote/manager/gateway/GatewayClientConnector.java@@ -133,6 +133,12 @@ public class GatewayClientConnector implements AutoCloseable {client.removeAllConnectionStatusConsumers();client.removeAllMessageConsumers();client.setEncoderDecoderProvider(null);++ if (this.activeTunnelSessions != null) {+ this.activeTunnelSessions.forEach(GatewayTunnelSession::disconnect);+ this.activeTunnelSessions.clear();+ }+} catch (Exception e) {LOG.log(Level.WARNING, "An exception occurred whilst trying to disconnect the gateway IO client", e);} finally {