Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wspy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
wspy
Commits
0de6f644
Commit
0de6f644
authored
Nov 07, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Client now delegates onping() and onpong() to Server for consistency
parent
512d6272
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
server.py
server.py
+8
-11
No files found.
server.py
View file @
0de6f644
...
@@ -39,21 +39,18 @@ class Server(object):
...
@@ -39,21 +39,18 @@ class Server(object):
logging
.
error
(
format_exc
(
e
))
logging
.
error
(
format_exc
(
e
))
def
onopen
(
self
,
client
):
def
onopen
(
self
,
client
):
"""
Called after `client' has completed its handshake.
"""
logging
.
debug
(
'Opened socket to client %s'
%
client
)
logging
.
debug
(
'Opened socket to client %s'
%
client
)
def
onmessage
(
self
,
client
,
message
):
def
onmessage
(
self
,
client
,
message
):
"""
Called when Message object `message' is received from `client'.
"""
logging
.
debug
(
'Received %s from %s'
%
(
message
,
client
))
logging
.
debug
(
'Received %s from %s'
%
(
message
,
client
))
def
onping
(
self
,
client
,
payload
):
logging
.
debug
(
'Sent ping "%s" to %s'
%
(
payload
,
client
))
def
onpong
(
self
,
client
,
payload
):
logging
.
debug
(
'Received pong "%s" from %s'
%
(
payload
,
client
))
def
onclose
(
self
,
client
):
def
onclose
(
self
,
client
):
"""
Called when `client' disconnects.
"""
logging
.
debug
(
'Closed socket to client %s'
%
client
)
logging
.
debug
(
'Closed socket to client %s'
%
client
)
...
@@ -69,10 +66,10 @@ class Client(WebSocket):
...
@@ -69,10 +66,10 @@ class Client(WebSocket):
self
.
server
.
onmessage
(
self
,
message
)
self
.
server
.
onmessage
(
self
,
message
)
def
onping
(
self
,
payload
):
def
onping
(
self
,
payload
):
logging
.
debug
(
'Sent ping "%s" to %s'
%
(
payload
,
self
)
)
self
.
server
.
onping
(
self
,
payload
)
def
onpong
(
self
,
payload
):
def
onpong
(
self
,
payload
):
logging
.
debug
(
'Received pong "%s" from %s'
%
(
payload
,
self
)
)
self
.
server
.
onpong
(
self
,
payload
)
def
onclose
(
self
):
def
onclose
(
self
):
self
.
server
.
onclose
(
self
)
self
.
server
.
onclose
(
self
)
...
...
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