Skip to content

Instantly share code, notes, and snippets.

@httpNick
Created April 3, 2015 22:04
Show Gist options
  • Save httpNick/03877ce4891924a8c0dc to your computer and use it in GitHub Desktop.
Save httpNick/03877ce4891924a8c0dc 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]))
socketIO = SocketIO('localhost', 8888, LoggingNamespace)
socketIO.on('isInHereResponse', getInHereResponse)
socketIO.on('connectionCountResponse', getConnectionResponse)
socketIO.emit('connectionCount')
socketIO.emit('isInHere', 'aaaaa')
socketIO.wait(seconds=3)
socketIO.disconnect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment