def connect():
global tokens
if (request.args.get('token', '') not in tokens):
disconnect()
return
global thread
if thread is None:
thread = socketio.start_background_task(target=background_thread)
# session['thread'] = socketio.start_background_task(background_thread, session['user'])
# emit('response', {'data': 'Connected'})
print('Client connected: ', request.sid)
# Disconnect the client and remove device if it has one
# Current: no accessable funtion
评论列表
文章目录