[Twisted-Python] A tcp server that handles many connections

Jean-Paul Calderone exarkun at divmod.com
Fri May 19 08:09:01 MDT 2006


On Fri, 19 May 2006 14:28:04 +0100, Deillon Thomas-WTD008 <wtd008 at motorola.com> wrote:
>I just have a general question using python.
>It is possible that a python script will be a XmlRPC server on the port
>5555 and at the same time a tcp-server on the port 6666 ?
>If yes.
>What I have to do to do a such thing ?
>

Actually this isn't a general Python question.  Here's how you do it with Twisted:


    reactor.listenTCP(5555, XMLRPCFactory)
    reactor.listenTCP(6666, SomeOtherFactory)

You may want to look at the writing servers document:

    http://twistedmatrix.com/projects/core/documentation/howto/servers.html

This is linked from one of the documentation pages on Twisted's website:

    http://twistedmatrix.com/projects/core/documentation/howto/index.html

Jean-Paul




More information about the Twisted-Python mailing list