Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
udp-demo
Project
Project
Details
Activity
Releases
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
demo
udp-demo
Commits
67316fd3
Commit
67316fd3
authored
Mar 24, 2021
by
barnettZQG
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log
parent
66291aec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
protocol_test.go
cmd/server/protocol_test.go
+3
-0
server.go
cmd/server/server.go
+2
-1
No files found.
cmd/server/protocol_test.go
View file @
67316fd3
...
...
@@ -6,6 +6,9 @@ func TestCreateTime(t *testing.T) {
t
.
Log
(
createTime
())
}
func
TestCRC32
(
t
*
testing
.
T
)
{
t
.
Log
(
CRC32
(
Hextob
(
"F1B000000006000199014C000219100000ED88621203"
)))
}
func
TestResponseMessage
(
t
*
testing
.
T
)
{
t
.
Log
(
BytetoH
(
responseMessage
(
Hextob
(
"F1B000000006000199014C000219100000ED8862120362D81046"
))))
}
cmd/server/server.go
View file @
67316fd3
...
...
@@ -23,8 +23,9 @@ func udpProcess(conn *net.UDPConn, index int) {
if
string
(
messageByte
)
==
"Healthcheck udp check"
{
return
}
fmt
.
Printf
(
"resquest: %X
\n
"
,
messageByte
)
response
:=
responseMessage
(
messageByte
)
fmt
.
Printf
(
"%X
\n
"
,
response
)
fmt
.
Printf
(
"
response:
%X
\n
"
,
response
)
conn
.
WriteToUDP
(
response
,
rAddr
)
<-
limitChan
}
...
...
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