tcp数据粘包处理
This commit is contained in:
@@ -86,8 +86,13 @@ public class AgentDecoderHandler extends ChannelInboundHandlerAdapter {
|
||||
if(!endsWith){
|
||||
lruCache.remove(sessionManager.client(ctx));
|
||||
tmpMsgSize = 0;
|
||||
sb.append(arr_msg[0]+"@tong-ran");
|
||||
lruCache.put(sessionManager.client(ctx), arr_msg[1], DateUnit.SECOND.getMillis() * 5000);
|
||||
for (int i = 0; i < arr_msg.length; i++) {
|
||||
if(i == arr_msg.length -1){
|
||||
lruCache.put(sessionManager.client(ctx), arr_msg[i], DateUnit.SECOND.getMillis() * 5000);
|
||||
}else{
|
||||
sb.append(arr_msg[i].replaceAll("agent-client:","")+"@tong-ran");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
lruCache.remove(sessionManager.client(ctx));
|
||||
tmpMsgSize = 0;
|
||||
|
||||
Reference in New Issue
Block a user