From bb8cdc0ec9e92e3b6e15692fbfff72822156f680 Mon Sep 17 00:00:00 2001
From: Xiajijian <1176061145@qq.com>
Date: Thu, 13 Nov 2025 13:32:41 +0800
Subject: [PATCH] 1.修改分组表名。 2.修改航线信息表字段名。
---
ard-sample/src/main/java/com/ard/sample/component/websocket/handler/DockWebSocketHandler.java | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/ard-sample/src/main/java/com/ard/sample/component/websocket/handler/DockWebSocketHandler.java b/ard-sample/src/main/java/com/ard/sample/component/websocket/handler/DockWebSocketHandler.java
index a6f4066..e682685 100644
--- a/ard-sample/src/main/java/com/ard/sample/component/websocket/handler/DockWebSocketHandler.java
+++ b/ard-sample/src/main/java/com/ard/sample/component/websocket/handler/DockWebSocketHandler.java
@@ -100,11 +100,12 @@
_liveStreamService.StartLiveStreaming(sn);
}
} else {
- // 停止直播
- if(MessageType.LIVESTREAM.getType().equals(type)){
- System.out.println("停止直播");
- _liveStreamService.StopLiveStreaming(sn);
- }
+ // 停止直播--前端不主动关注直播,则在断开连接时停止
+// if(MessageType.LIVESTREAM.getType().equals(type)){
+// System.out.println("停止直播");
+//
+// _liveStreamService.StopLiveStreaming(sn);
+// }
// 取消订阅操作
if (subscriptions.containsKey(subscriptionKey)) {
subscriptions.get(subscriptionKey).remove(userId);
@@ -138,12 +139,13 @@
*/
private void removeUserAllSubscriptions(String userId) {
for (Map.Entry<String, Set<String>> entry : subscriptions.entrySet()) {
- if (entry.getKey().contains(MessageType.LIVESTREAM.getType())) {
- String sn = entry.getKey().split(":")[0];
- _liveStreamService.StopLiveStreaming(sn);
- }
+ // 停止直播逻辑
entry.getValue().remove(userId);
if (entry.getValue().isEmpty()) {
+ if (entry.getKey().contains(MessageType.LIVESTREAM.getType())) {
+ String sn = entry.getKey().split(":")[0];
+ _liveStreamService.StopLiveStreaming(sn);
+ }
subscriptions.remove(entry.getKey());
}
}
--
Gitblit v1.9.3