Hi there!<div><br></div><div>Can someone give me a hand in how to daemonize one application?</div><div><br></div><div>My application has two udp servers that subclass from DatagramProtocol and are launched via reactor.listenUDP.</div>

<div><br></div><div>I think that the way to go is twistd, however some doubts come to me as flask is involved and even I don't know if this is the proper place to ask (maybe the flask support list?)</div><div><br></div>

<div>My current implementation goes like this:</div><div><span class="s1"><br></span></div>class Server(DatagramProtocol):<br><br>def datagramReceived(self, data, (host, port)):<br><br>....<br><br>sever = Server()<br><br>

reactor.listenUDP(port, server)<br><br>....<div><p class="p1">To deploy the app, in the application framework doc is said that you can create a .tac file for using with twistd. In this tac file I think that I need to wrap my "DatagramProtocol" into a Factory, then within a Service and link that service to the application. No problem on that (I think)</p>

<p class="p1">However, I'm also using flask for exposing a basic restful api. And I have no idea in how I can wrap it into a factory/service/application.</p><p class="p1">In my code flask is tied to the reactor in the following way:</p>

<p class="p1">flask_app = Flask(__name__, static_folder=<span class="s1">"</span><span class="s2">www</span><span class="s1">"</span>, static_url_path=<span class="s1">""</span>)   </p><p class="p1">flask_resource = WSGIResource(reactor, reactor.<span class="s4">getThreadPool</span>(), flask_app)</p>

<p class="p1">










</p><p class="p1">flask_site = Site(flask_resource)</p><p class="p1">







</p><p class="p1">reactor.<span class="s1">listenTCP</span>(<span class="s2">8080</span>, flask_site)</p><p class="p1">--------</p><p class="p1">In the flask website it's said that you can run a flask application using a standalone wsgi container like the default twisted one with: </p>

<p class="p1">twistd web --wsgi myproject.app</p><p class="p1">However I think that it has nothing to do with my problem.</p><p class="p1">I'm not a twisted expert however I've been using it from the past six months, but running it under Eclipse and directly under the console, however now is time to deploy and I'm really confused with all this Application, Service, MultiService, Factory, Protocol and such stuff. listenTCP and listenUDP seemed so easy!!! ;)</p>

<p class="p1">At this point I'm in a dead end trying to run the app at startup, any suggestion?, other alternative to twistd?</p><p class="p1">Thanks in advance, best regards, Beth.</p></div><div><br></div>