[問題] socketio & thread

作者: gn00618777 (非常念舊)   2015-05-16 20:23:54
我在 flask 框架下使用 sokcetio,以下是草略架構
server.py:
from flask import Flask
from threadin import Thread
app = Flask(__name__)
socketio = SocketIO(app)
def background_thread():
while True:
...
...
@app.route('/')
def index():
thread = Thread(target=background_thread)
tread.start()
return render_template('receiver.html')
@socketio.on('connect',namespace='/test')
作者: dritchie (卍~邁斯納效應~卍)   2015-05-17 10:04:00

Links booklink

Contact Us: admin [ a t ] ucptt.com