socket.py 284 B

12345678910
  1. from openerp.service.server import sio
  2. @sio.on('connect', namespace='/')
  3. def join(sid, data):
  4. sio.emit('connect', data='Welcome to Chat!!!', room=sid)
  5. @sio.on('message', namespace='/')
  6. def chat(sid, message):
  7. print message
  8. sio.emit('message', data=message, skip_sid=sid)