Commit 1274b8bc authored by Administrator's avatar Administrator

报文长度修改为5k

parent edd0cf99
...@@ -134,7 +134,8 @@ public class EchoClient { ...@@ -134,7 +134,8 @@ public class EchoClient {
natMessage.setType(PacketCommon.TYPE_TRANSFER); natMessage.setType(PacketCommon.TYPE_TRANSFER);
//write,但是不需要 flush //write,但是不需要 flush
natChannel.write(natMessage); natChannel.write(natMessage);
EchoLogger.getLogger().info("receive data from real server endpoint with big packet, forward to natChannel"); EchoLogger.getLogger().info("receive data from real server endpoint with big packet," +
" forward to natChannel with segment packet");
} }
if (msg.readableBytes() > 0) { if (msg.readableBytes() > 0) {
EchoPacket natMessage = new EchoPacket(); EchoPacket natMessage = new EchoPacket();
...@@ -145,6 +146,8 @@ public class EchoClient { ...@@ -145,6 +146,8 @@ public class EchoClient {
natMessage.setType(PacketCommon.TYPE_TRANSFER); natMessage.setType(PacketCommon.TYPE_TRANSFER);
natChannel.writeAndFlush(natMessage); natChannel.writeAndFlush(natMessage);
EchoLogger.getLogger().info("receive data from real server endpoint with big packet," +
" forward to natChannel for final packet");
} else { } else {
natChannel.flush(); natChannel.flush();
} }
......
...@@ -14,7 +14,7 @@ public class PacketCommon { ...@@ -14,7 +14,7 @@ public class PacketCommon {
static final long magic = 0x6563686F2E303031L; static final long magic = 0x6563686F2E303031L;
//单个报文,最大1M,超过1M需要分段 //单个报文,最大1M,超过1M需要分段
public static final int MAX_FRAME_LENGTH = 1024 * 1024; public static final int MAX_FRAME_LENGTH = 5 * 1024;
//心跳相关 //心跳相关
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment