Created
April 5, 2016 10:32
-
-
Save abhigenie92/6058ac4eaece520ccd92c195b0201689 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
I have a flask server for voip application. I user sends a http request and then I open port for sending data between clients | |
communicating. | |
I use twisted to create reactor and transfer the data between clients. The reactor is created in the flask function which responds | |
to the http reqeust. | |
@app.route('/start_server',methods=['POST']) | |
def start_server(): | |
port = reactor.listenTCP(0, Factory()) | |
port.getHost().port | |
reactor.run() | |
return jsonify({"port":port}) | |
Now other clients can connect to the server and communicate via the twisted reactor's event loop shown below. | |
Question: After the function start_server() returns and will the reactor started in it will alive like thread? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment