Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socketIO_client import SocketIO, BaseNamespace
- class ChatNamespace(BaseNamespace):
- def on_connect(self):
- print('connect')
- def on_disconnect(self):
- print('disconnect')
- def on_reconnect(self):
- print('reconnect')
- socketIO = SocketIO('localhost', 6666)
- chat_namespace = socketIO.define(ChatNamespace, '/chat')
- chat_namespace.emit('message', {'author': 'domo', 'message': 'test'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement