Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. from socketIO_client import SocketIO, BaseNamespace
  2.  
  3.  
  4. class ChatNamespace(BaseNamespace):
  5.  
  6. def on_connect(self):
  7. print('connect')
  8.  
  9. def on_disconnect(self):
  10. print('disconnect')
  11.  
  12. def on_reconnect(self):
  13. print('reconnect')
  14.  
  15.  
  16. socketIO = SocketIO('localhost', 6666)
  17. chat_namespace = socketIO.define(ChatNamespace, '/chat')
  18.  
  19. chat_namespace.emit('message', {'author': 'domo', 'message': 'test'})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement