| | |
| | | this.userId = userId; |
| | | |
| | | webSocketMap.put(userId, this); |
| | | log.info("webSocketMap -> " + JSON.toJSONString(webSocketMap)); |
| | | //log.info("webSocketMap -> " + JSON.toJSONString(webSocketMap)); |
| | | |
| | | addOnlineCount(); // 在线数 +1 |
| | | //log.info("【气体通量实时推送】有新窗口开始监听:" + userId + ",当前在线人数为" + getOnlineCount()); |
| | |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session) { |
| | | log.info("收到来自窗口" + userId + "的信息:" + message); |
| | | //log.info("收到来自窗口" + userId + "的信息:" + message); |
| | | |
| | | if (StringUtils.isNotBlank(message)) { |
| | | try { |
| | |
| | | */ |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("用户错误:" + this.userId + ",原因:" + error.getMessage()); |
| | | error.printStackTrace(); |
| | | //log.error("用户错误:" + this.userId + ",原因:" + error.getMessage()); |
| | | //error.printStackTrace(); |
| | | } |
| | | |
| | | /** |