From 8e1ee5781fb9c3a812c24934d74272bcc1a6eaa0 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期四, 18 七月 2024 10:26:29 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
---
hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java
index 75f66fe..a67c8f2 100644
--- a/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java
+++ b/hangzhoumesParent/common/servicebase/src/main/java/com/mes/tools/WebSocketServer.java
@@ -22,12 +22,6 @@
public static ConfigurableApplicationContext applicationContext;
- // 瑙e喅鏃犳硶娉ㄥ叆mapper闂 //浣跨敤鏂规硶
- // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class);
- public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) {
- WebSocketServer.applicationContext = configurableApplicationContext;
- }
-
private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class);
private List<String> messages;
/**
@@ -49,6 +43,8 @@
public void onOpen(Session session, @PathParam("username") String username) {
this.username = username;
this.session = session;
+ this.session.setMaxTextMessageBufferSize(12*1024*1024);
+ this.session.setMaxBinaryMessageBufferSize(12*1024*1024);
List<WebSocketServer> webSocketServers = sessionMap.get(username);
if (webSocketServers == null) {
ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>();
@@ -102,7 +98,7 @@
*
* @param message 瀹㈡埛绔彂閫佽繃鏉ョ殑娑堟伅
*/
- @OnMessage
+ @OnMessage(maxMessageSize = 5242880)
public void onMessage(String message, Session session, @PathParam("username") String username) {
log.info("鏈嶅姟绔敹鍒扮敤鎴穟sername={}鐨勬秷鎭�:{}", username, message);
JSONObject obj = JSONUtil.parseObj(message);
@@ -111,8 +107,6 @@
JSONObject jsonObject = new JSONObject();
jsonObject.set("message", text);
this.messages.add(text);
- this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject)
-
}
@OnError
--
Gitblit v1.8.0