Last active
June 27, 2019 07:09
-
-
Save Nipun2016/4cf9dcfa70cc39bb9bc4612d4703068c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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