tcp数据粘包处理

This commit is contained in:
qiminbao
2025-09-23 09:40:47 +08:00
parent 8658a7bef8
commit 0299bbcb5d
@@ -119,6 +119,7 @@ public class AgentDecoderHandler extends ChannelInboundHandlerAdapter {
if(endsWith){
content = content.replaceAll("agent-client:","");
String[] arr = content.split("@tong-ran");
try {
for (String message : arr) {
JSONObject jsonObject = JSONObject.parseObject(message);
String clientId = jsonObject.getString("clientId");
@@ -140,6 +141,9 @@ public class AgentDecoderHandler extends ChannelInboundHandlerAdapter {
}
}
}catch (Exception e){
AssertLog.error("=====channelRead:{}=====" + e.getMessage());
}
}
if (isClear) {
lruCache.remove(sessionManager.client(ctx));