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
Websocket and Util.Retry bug fixes
Rich Turner586d12dc8e6a
diff --git a/agent/src/main/java/org/openremote/agent/protocol/io/AbstractNettyIoClient.java b/agent/src/main/java/org/openremote/agent/protocol/io/AbstractNettyIoClient.javaindex 626cea858..0cb4bfd8a 100644--- a/agent/src/main/java/org/openremote/agent/protocol/io/AbstractNettyIoClient.java+++ b/agent/src/main/java/org/openremote/agent/protocol/io/AbstractNettyIoClient.java@@ -283,11 +283,13 @@ public abstract class AbstractNettyIoClient<T, U extends SocketAddress> implemen// Add closed callbackchannel.closeFuture().addListener(future -> {- if (connectionStatus == ConnectionStatus.CONNECTED) {- LOG.info("Connection closed un-expectedly: " + getClientUri());- onConnectionStatusChanged(ConnectionStatus.CONNECTING);- doDisconnect();- scheduleDoConnect();+ synchronized (this) {+ if (connectionStatus == ConnectionStatus.CONNECTED) {+ LOG.info("Connection closed un-expectedly: " + getClientUri());+ onConnectionStatusChanged(ConnectionStatus.CONNECTING);+ doDisconnect();+ scheduleDoConnect();+ }}});diff --git a/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketIoClient.java b/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketIoClient.javaindex d47437b7b..71e1ac2ee 100644--- a/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketIoClient.java+++ b/agent/src/main/java/org/openremote/agent/protocol/websocket/WebsocketIoClient.java@@ -120,7 +120,6 @@ public class WebsocketIoClient<T> extends AbstractNettyIoClient<T, InetSocketAdd} else if (frame instanceof PongWebSocketFrame) {LOG.finest("Websocket client pong received");} else if (frame instanceof CloseWebSocketFrame) {- System.out.println("WebSocket Client received closing");ch.close();}}diff --git a/container/src/main/java/org/openremote/container/util/Util.java b/container/src/main/java/org/openremote/container/util/Util.javaindex 2f6e7559e..23555b8d9 100644--- a/container/src/main/java/org/openremote/container/util/Util.java+++ b/container/src/main/java/org/openremote/container/util/Util.java@@ -111,6 +111,7 @@ public class Util {return;}+ running = false;future.cancel(mayInterrupt);}@@ -125,6 +126,10 @@ public class Util {log(Level.INFO, name + ": threw an exception", e);}+ if (!running) {+ return;+ }+if (success) {if (successCallback != null) {successCallback.run();