Skip to content

Instantly share code, notes, and snippets.

@httpNick
Created April 5, 2015 05:16
Show Gist options
  • Save httpNick/cce44a68189d97507c12 to your computer and use it in GitHub Desktop.
Save httpNick/cce44a68189d97507c12 to your computer and use it in GitHub Desktop.
__author__ = 'httpnick'
from socketIO_client import SocketIO, LoggingNamespace
def getInHereResponse(*args):
print(args[0])
def getConnectionResponse(*args):
print('connection count: ' + str(args[0]))
def getStatsResponse(*args):
print(args[0])
socketIO = SocketIO('localhost', 8888, LoggingNamespace)
socketIO.on('isInHereResponse', getInHereResponse)
socketIO.on('connectionCountResponse', getConnectionResponse)
socketIO.on('getDBStatsResponse', getStatsResponse)
socketIO.emit('connectionCount')
socketIO.emit('isInHere', 'httpNick')
socketIO.emit('getDBStats')
socketIO.wait(seconds=1)
socketIO.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment