[Twisted-Python] How do I run a twisted server directly

Alexander May alex-news at comcast.net
Fri May 14 15:56:58 EDT 2004


I am going step by step through the Twisted From Scratch documentation.  At
step labeled twistd, there is this listing:

http://twistedmatrix.com/documents/current/howto/listings/finger/finger11.py

At the end it uses:

application = service.Application('finger', uid=1, gid=1)
factory = FingerFactory(moshez='Happy and well')
internet.TCPServer(79, factory).setServiceParent(
    service.IServiceCollection(application))

Where as the previous code uses:

reactor.listenTCP(1079, FingerFactory(prefix='http://livejournal.com/~'))
reactor.run()

And then gets into twistd, which is great.  But I have two questions, one is
how do I run this code directly (i.e., without twistd), and how do I use a
debugger on code running under twistd.

Maybe the answer to my first question in look at twistd in an editor and
figure it out, and the answer to the second question is run twistd in the
debugger.  To be honest I haven't looked at twistd, as I am already
suffering for mind overload trying to understand the bits and pieces of this
framework.  Pretty cool stuff.

On a different unrelated subject, I am going to need to act as both a server
and a client for SOAP.  Can someone point me in the right direction on how
to do this in twisted.

Thanks,
Alex








More information about the Twisted-Python mailing list