From aedf1c438d5df3834c57a198183c550a73c47f34 Mon Sep 17 00:00:00 2001 From: whycxzp <perryhsu@163.com> Date: 星期四, 27 七月 2023 11:33:35 +0800 Subject: [PATCH] 更新 --- src/main/java/com/whyc/webSocket/GroupStationSocket.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/whyc/webSocket/GroupStationSocket.java b/src/main/java/com/whyc/webSocket/GroupStationSocket.java index 1813bf8..3b60539 100644 --- a/src/main/java/com/whyc/webSocket/GroupStationSocket.java +++ b/src/main/java/com/whyc/webSocket/GroupStationSocket.java @@ -42,10 +42,10 @@ @OnOpen public void onOpen(Session session, EndpointConfig config){ this.session = session; - HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession"); - UserInf user = (UserInf) httpSession.getAttribute("user"); - final int userId = user.getUId().intValue(); - //final int userId = 1001; + //HttpSession httpSession = (HttpSession) config.getUserProperties().get("httpSession"); + //UserInf user = (UserInf) httpSession.getAttribute("user"); + //final int userId = user.getUId().intValue(); + final int userId = 1001; Thread thread = new Thread() { @Override public void run() { @@ -53,7 +53,7 @@ while (!currentThread().isInterrupted()) { Response groupWithStationAndAlarm = baoJiGroupService.getGroupWithStationAndAlarm(userId); session.getBasicRemote().sendObject(groupWithStationAndAlarm); - sleep(4000); + sleep(10000); } } catch (Exception e) { e.printStackTrace(); -- Gitblit v1.9.1