Skip to content

Instantly share code, notes, and snippets.

@Nipun2016
Last active June 27, 2019 07:09
Show Gist options
  • Save Nipun2016/4cf9dcfa70cc39bb9bc4612d4703068c to your computer and use it in GitHub Desktop.
Save Nipun2016/4cf9dcfa70cc39bb9bc4612d4703068c to your computer and use it in GitHub Desktop.
async_mode = None
import os
from django.http import HttpResponse
import socketio
basedir = os.path.dirname(os.path.realpath(__file__))
sio = socketio.Server(async_mode='eventlet')\
@sio.on('connection-bind')
def connection_bind(sid, data):
// code to capture the data
// sid is a unique id for each connection and data contains additional payload of the message.
@sio.on('disconnect')
def test_disconnect(sid):
// code to capture the data
// sid is a unique id for each connection and data contains additional payload of the message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment