Skip to content

Commit

Permalink
fixed ping-pong bug in accordance with latest sc-library release
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Feb 29, 2020
1 parent 19e9258 commit 9c52b96
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion main.py
Expand Up @@ -56,7 +56,7 @@ def suback(channel, error, object):
socket.setBasicListener(onconnect, ondisconnect, onConnectError)
socket.setAuthenticationListener(onSetAuthentication, onAuthentication)
socket.onack('ping', messsageack)
socket.enablelogger(False)
socket.enablelogger(True)
# socket.on('yell', message)
# socket.setreconnection(True)
socket.connect()
Expand Down
10 changes: 6 additions & 4 deletions setup.py
Expand Up @@ -6,28 +6,30 @@ def readme():
if os.path.exists('README.md'):
with open('README.md') as f:
return f.read()
else:
else:
return "Python client for socket-cluster framework in node.js"


version = '1.3.5'

setup(
name='socketclusterclient',
packages=['socketclusterclient'], # this must be the same as the name above
version='1.3.4',
version=version,
description='Client library for socketcluster framework in nodejs',
long_description=readme(),
author='Sachin Shinde',
author_email='sachinshinde7676@gmail.com',
license='MIT',
url='https://github.com/sacOO7/socketcluster-client-python', # use the URL to the github repo
download_url='https://github.com/sacOO7/socketcluster-client-python/tarball/v1.3.4',
download_url='https://github.com/sacOO7/socketcluster-client-python/tarball/v' + version,
keywords=['websocket', 'socketcluster', 'nodejs', 'client', 'socketclusterclient'], # arbitrary keywords
install_requires=[
'websocket-client<=0.48',
],
classifiers=[],
)


# python setup.py register -r pypitest
# python setup.py sdist upload -r pypitest
# python setup.py register -r pypi
Expand Down
7 changes: 4 additions & 3 deletions socketclusterclient/Socketcluster.py
Expand Up @@ -15,7 +15,7 @@
class socket(Emitter.emitter):
def enablelogger(self, enabled):
if (enabled):
sclogger.setLevel(logging.NOTSET)
sclogger.setLevel(logging.DEBUG)
else:
sclogger.setLevel(logging.WARNING)

Expand Down Expand Up @@ -125,8 +125,9 @@ def __missing__(self, key):
return ''

def on_message(self, ws, message):
if message == "#1":
self.ws.send("#2")
if message == "":
self.ws.send("")
sclogger.debug("received ping, sending pong back")
else:
sclogger.debug(message)
mainobject = json.loads(message, object_hook=self.BlankDict)
Expand Down

0 comments on commit 9c52b96

Please sign in to comment.