whyclxw
2025-05-28 e16302f9d475c7cc4dd18c5abf1a23cb5502e362
src/main/java/com/whyc/webSocket/AnalysisSocket.java
@@ -47,14 +47,11 @@
    @OnOpen
    public void onOpen(Session session, EndpointConfig config) {
        this.session = session;
        this.httpSession = (HttpSession) config.getUserProperties().get("httpSession");
    }
    @OnMessage
    public synchronized void onMessage(Session session, String message) {
        AnalysisDto dto = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(message,AnalysisDto.class);
        UserInf user = (UserInf) httpSession.getAttribute("user");
        final int userId = user.getUId().intValue();
        thread = new Thread("Thread_Analysis") {
            @Override
            public void run() {
@@ -62,7 +59,7 @@
                    Thread thread = currentThread();
                    threadFlagMap.put(thread.getId(), true);
                    try {
                        Response res = service.getAnalysisSocket(dto,userId);
                        Response res = service.getAnalysisSocket(dto);
                        if (session.isOpen()) {
                            //推送信息
                            synchronized (session) {