app.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:MyIoT 作者: xswxm 项目源码 文件源码
def test_disconnect():
    # here we have to use the sid to locate the the disconnected device
    # and if it exists, remove its room and set it as unaceessable
    try:
        close_room(request.sid)
    except Exception as e:
        logging.debug(e)

    # Remove token if exist
    global tokens
    token = request.args.get('token', '')
    if token in tokens:
        tokens.remove(token)
        logging.debug("Token removed:" + token)
    # disconnect()
    print('Client disconnected: ', request.sid)


# @app.route('/')
# def index():
#     return render_template('index.html', async_mode=socketio.async_mode)


# @socketio.on('request', namespace = mynamespace)
# def broadcast_message(message):
#     message = {'data': {'message': 'I am the message'}}
#     emit('response',
#          {'data': message['data']['message']},
#          broadcast=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号