<br><br><div class="gmail_quote">On Mon, Mar 28, 2011 at 8:29 AM, Aljoša Mohorović <span dir="ltr">&lt;<a href="mailto:aljosa.mohorovic@gmail.com">aljosa.mohorovic@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
is it possible to run several services from a single app?<br>
i currently have a few services/apps and would like to put them all<br>
into a single app so i can use cx_freeze to create a single exe file<br>
for windows to allow easy testing.<br>
<br>
Aljosa<br>
<br>
maybe something like this:<br>
--------------------------------------------------------<br>
factory1 = protocol.ServerFactory()<br>
factory1.protocol = Protocol1<br>
application1 = service.Application(&quot;Server1&quot;)<br>
internet.TCPServer(8000, factory1).setServiceParent(application1)<br>
<br>
factory2 = protocol.ServerFactory()<br>
factory2.protocol = Protocol2<br>
application2 = service.Application(&quot;Server2&quot;)<br>
internet.TCPServer(9000, factory2).setServiceParent(application2)<br>
<br>
reactor.listenTCP(8000, factory1)<br>
reactor.listenTCP(9000, factory2)<br>
<br>
reactor.run() </blockquote><br><br>Get rid of &#39;application1&#39; and &#39;application2&#39; and just create a single one named &#39;application&#39; , delete the last three lines, and this code will work just fine as a .tac file. You only need one call to &#39;Application&#39; per process, but you can have many services and many clients and servers in a process.<br>
</div>