Skip to content

Commit 683257f

Browse files
authored
Merge pull request #3410 from ControlSystemStudio/CSSTUDIO-1967
Terminate connection attempts when app is closed
2 parents 59c42e7 + 2e5ee62 commit 683257f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/websocket/src/main/java/org/phoebus/core/websocket/WebSocketClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ public CompletionStage<?> onText(WebSocket webSocket,
178178
*/
179179
public void close(String reason) {
180180
keepPinging.set(false);
181-
webSocket.sendClose(1000, reason);
181+
attemptReconnect.set(false);
182+
// webSocket is null if never connected
183+
if(webSocket != null){
184+
webSocket.sendClose(1000, reason);
185+
}
182186
}
183187

184188
/**

0 commit comments

Comments
 (0)