Commit 3ae72e4c authored by duanruiming's avatar duanruiming

[update] ws客户端连接添加日志

parent cd8e8b58
......@@ -37,6 +37,7 @@ public class WebSocketClient implements CommandLineRunner {
String crossId = crossInfoPO.getId();
String uri = "ws://localhost:32000/utc/signalStatus/" + crossId + ",preload";
session = container.connectToServer(WebSocketClientHandler.class, URI.create(uri));
log.info("ws客户端建立成功:[{}]", crossId);
}
}
} catch (Exception e) {
......
......@@ -16,6 +16,7 @@ import javax.websocket.*;
public class WebSocketClientHandler {
@OnOpen
public void onOpen(Session session) {
log.info("WebSocketClientHandler onOpen: {}", session);
WebSocketClient.session = session;
}
......@@ -31,7 +32,7 @@ public class WebSocketClientHandler {
@OnClose
public void close() {
log.info("WebSocketClientHandler close: {}", WebSocketClient.session);
}
}
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