Browse Source

1.Soekct文字消息增加判空

master
wangwanlei 10 months ago
parent
commit
948e1da88f

+ 5
- 1
websocket/src/main/java/com/xhly/websocket/service/SocketClient.java View File

@@ -13,6 +13,8 @@ import com.neovisionaries.ws.client.WebSocketFactory;
13 13
 import com.neovisionaries.ws.client.WebSocketFrame;
14 14
 import com.xhly.corelib.utils.NetworkUtils;
15 15
 
16
+import org.w3c.dom.Text;
17
+
16 18
 import java.io.IOException;
17 19
 import java.util.List;
18 20
 import java.util.Map;
@@ -364,7 +366,9 @@ public abstract class SocketClient {
364 366
         public void onTextMessage(WebSocket websocket, String text) throws Exception {
365 367
             super.onTextMessage(websocket, text);
366 368
             hasReceiveHeart();
367
-            processTextMessage(text);
369
+            if (!TextUtils.isEmpty(text)){
370
+                processTextMessage(text);
371
+            }
368 372
         }
369 373
     }
370 374
 }

Loading…
Cancel
Save