Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
echo-lib-Deprecated
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
echo
echo-lib-Deprecated
Commits
1274b8bc
Commit
1274b8bc
authored
Aug 08, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报文长度修改为5k
parent
edd0cf99
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
EchoClient.java
src/main/java/com/virjar/echo/nat/client/EchoClient.java
+4
-1
PacketCommon.java
src/main/java/com/virjar/echo/nat/protocol/PacketCommon.java
+1
-1
No files found.
src/main/java/com/virjar/echo/nat/client/EchoClient.java
View file @
1274b8bc
...
...
@@ -134,7 +134,8 @@ public class EchoClient {
natMessage
.
setType
(
PacketCommon
.
TYPE_TRANSFER
);
//write,但是不需要 flush
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
)
{
EchoPacket
natMessage
=
new
EchoPacket
();
...
...
@@ -145,6 +146,8 @@ public class EchoClient {
natMessage
.
setType
(
PacketCommon
.
TYPE_TRANSFER
);
natChannel
.
writeAndFlush
(
natMessage
);
EchoLogger
.
getLogger
().
info
(
"receive data from real server endpoint with big packet,"
+
" forward to natChannel for final packet"
);
}
else
{
natChannel
.
flush
();
}
...
...
src/main/java/com/virjar/echo/nat/protocol/PacketCommon.java
View file @
1274b8bc
...
...
@@ -14,7 +14,7 @@ public class PacketCommon {
static
final
long
magic
=
0x6563686F2E303031
L
;
//单个报文,最大1M,超过1M需要分段
public
static
final
int
MAX_FRAME_LENGTH
=
1024
*
1024
;
public
static
final
int
MAX_FRAME_LENGTH
=
5
*
1024
;
//心跳相关
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment