dont call the .run() method, call the .start() method which is defined the Thread class (and should NOT be overridden).<div><br></div><div>tftpserv.start()</div><div><br></div><div>xmlserv.start()</div><div><br></div><div>
 <br><br><div class="gmail_quote">On Fri, Feb 12, 2010 at 10:57 PM, Jordan Apgar <span dir="ltr"><<a href="mailto:twistedphrame@gmail.com">twistedphrame@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'm trying to run two servers in the same program at once.  Here are<br>
the two:<br>
class TftpServJ(Thread):<br>
    def __init__(self, ip, root, port=69, debug = False ):<br>
        Thread.__init__(self)<br>
        setup stuff here<br>
<br>
    def run(self):<br>
        try:<br>
            self.server.listen(self.ip, self.port)<br>
        except KeyboardInterrupt:<br>
            pass<br>
<br>
and<br>
class XMLServer(Thread):<br>
    def __init__(self, host, port, hostid, rsa_key):<br>
        Thread.__init__(self)<br>
         setup stuff<br>
<br>
    def run(self):<br>
        self.server.serve_forever()<br>
<br>
<br>
I call them as:<br>
tftpserv = TftpServJ(host, "/home/twistedphrame/Desktop/xmlrpc_server/<br>
server")<br>
tftpserv.run()<br>
xmlserv = XMLServer(host, port, HostID, key)<br>
xmlserv.run()<br>
<br>
<br>
it seems that tftpserv runs but wont go on to spawn xmlserv as well.<br>
do I need to fork if I want both these to run at the same time?  It<br>
was my impression that by using Thread execution in the main program<br>
would continue.<br>
<font color="#888888"><br>
<br>
<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br></div>