Skip to content

Commit c0a2341

Browse files
committed
Cleaner packet decoding
1 parent 9660a72 commit c0a2341

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

socketio.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#Protocol: https://github.com/LearnBoost/socket.io-spec
2828

29-
#Todo: Json and event parsing (Json is implemented but not tested)
3029

3130
'''
3231
Usage:
@@ -152,7 +151,10 @@ def receiveEvent(self, timeout = 0):
152151

153152
#remove the header from a package
154153
def decode(self, m):
155-
return m[4:]
154+
m = m.split(':').pop(0).pop(0).pop(0)
155+
return ''.join(i for i in m)
156+
157+
156158

157159
def connect(self):
158160
#before connecting to the server we need to get a client id

0 commit comments

Comments
 (0)