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
34ba12b2
Commit
34ba12b2
authored
Oct 14, 2016
by
alexstocks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add conn.go:(gettyWSConn)handlePing & conn.go:(gettyWSConn)handlePong
parent
ddb95afc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
conn.go
conn.go
+15
-0
dev.list
dev.list
+5
-0
No files found.
conn.go
View file @
34ba12b2
...
...
@@ -184,11 +184,26 @@ func newGettyWSConn(conn *websocket.Conn) *gettyWSConn {
peer
:
peerAddr
,
},
}
conn
.
SetPingHandler
(
gettyWSConn
.
handlePing
)
conn
.
SetPongHandler
(
gettyWSConn
.
handlePong
)
return
gettyWSConn
}
func
(
this
*
gettyWSConn
)
handlePing
(
message
string
)
error
{
err
:=
this
.
conn
.
WriteMessage
(
websocket
.
PongMessage
,
[]
byte
(
message
))
if
err
==
websocket
.
ErrCloseSent
{
err
=
nil
}
else
if
e
,
ok
:=
err
.
(
net
.
Error
);
ok
&&
e
.
Temporary
()
{
err
=
nil
}
if
err
==
nil
{
this
.
UpdateActive
()
}
return
err
}
func
(
this
*
gettyWSConn
)
handlePong
(
string
)
error
{
this
.
UpdateActive
()
return
nil
...
...
dev.list
View file @
34ba12b2
...
...
@@ -11,6 +11,11 @@
## develop history ##
---
- 2016/10/14
> 1 add conn.go:(gettyWSConn)handlePing
>
> 2 add conn.go:(gettyWSConn)handlePong
- 2016/10/13
> 1 add conn.go:(gettyWSConn)writePing which is invoked automatically in session.go:(Session)handleLoop
>
...
...
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