Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
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
wei.xuan
getty
Commits
070dca7f
Commit
070dca7f
authored
May 23, 2019
by
u0x01
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mod: error fmt
parent
8d9cf087
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
conn.go
conn.go
+2
-2
server.go
server.go
+1
-1
No files found.
conn.go
View file @
070dca7f
...
...
@@ -399,7 +399,7 @@ func (u *gettyUDPConn) read(p []byte) (int, *net.UDPAddr, error) {
}
length
,
addr
,
err
=
u
.
conn
.
ReadFromUDP
(
p
)
// connected udp also can get return @addr
log
.
Debugf
(
"ReadFromUDP() = {length:%d, peerAddr:%s, error:%
s
}"
,
length
,
addr
,
err
)
log
.
Debugf
(
"ReadFromUDP() = {length:%d, peerAddr:%s, error:%
v
}"
,
length
,
addr
,
err
)
if
err
==
nil
{
atomic
.
AddUint32
(
&
u
.
readBytes
,
uint32
(
length
))
}
...
...
@@ -449,7 +449,7 @@ func (u *gettyUDPConn) Write(udpCtx interface{}) (int, error) {
if
length
,
_
,
err
=
u
.
conn
.
WriteMsgUDP
(
buf
,
nil
,
peerAddr
);
err
==
nil
{
atomic
.
AddUint32
(
&
u
.
writeBytes
,
(
uint32
)(
len
(
buf
)))
}
log
.
Debugf
(
"WriteMsgUDP(peerAddr:%s) = {length:%d, error:%
s
}"
,
peerAddr
,
length
,
err
)
log
.
Debugf
(
"WriteMsgUDP(peerAddr:%s) = {length:%d, error:%
v
}"
,
peerAddr
,
length
,
err
)
return
length
,
perrors
.
WithStack
(
err
)
//return length, err
...
...
server.go
View file @
070dca7f
...
...
@@ -116,7 +116,7 @@ func (s *server) stop() {
if
err
=
s
.
server
.
Shutdown
(
ctx
);
err
!=
nil
{
// if the log output is "shutdown ctx: context deadline exceeded", it means that
// there are still some active connections.
log
.
Errorf
(
"server shutdown ctx:%s error:%
s
"
,
ctx
,
err
)
log
.
Errorf
(
"server shutdown ctx:%s error:%
v
"
,
ctx
,
err
)
}
}
s
.
server
=
nil
...
...
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