tcp数据粘包处理
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user