Commit 26d2fc6e by 钱炳权

修复websocket刷新数据丢失问题

parent b7729b83
......@@ -230,7 +230,8 @@ public class TestCmdTools {
}
}).start();
websocketClientServiceImpl.webSocketClient.send(data);
} catch (Exception ignored) {
} catch (Exception e) {
log.error("Web is disconnected:[{}]", e.getMessage());
}
}
}
......
......@@ -54,8 +54,8 @@ public class WebSocket {
for (String name : WEBSOCKET_CONCURRENTHASHMAP.keySet()) {
if (this == WEBSOCKET_CONCURRENTHASHMAP.get(name)) {
WEBSOCKET_CONCURRENTHASHMAP.remove(name);
log.info("The man {} disconnected! ", name);
break;
}
}
......@@ -103,8 +103,8 @@ public class WebSocket {
// WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(sender + ":" + message);
WEBSOCKET_CONCURRENTHASHMAP.get(name).session.getBasicRemote().sendText(message);
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
log.error("Web is closed!");
}
}
......
......@@ -27,7 +27,7 @@
}
</script>
<body onload="javascript:myFunction()">
<div id="sendDiv">
<div id="sendDiv"> ,
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment