[Twisted-Python] Combine XMLRPC and PB in one server?

jarrod roberson jarrod.roberson at gmail.com
Thu Jun 16 18:46:51 EDT 2005


On 6/14/05, apocalypznow <apocalypznow at gmail.com> wrote:
> 
> How do you make a server that handles both XMLRPC and PB?
> 
> How do you do this as a service?
> 
> When I mean service, I mean as in the following code:
> 
> application = twisted.application.service.Application("pbserver")
> myService = twisted.application.service.IServiceCollection(application)
> 
> p = portal.Portal(DefaultRealm())
> dbu=twisted.cred.checkers.InMemoryUsernamePasswordDatabaseDontUse()
> dbu.addUser("user1","pass1")
> p.registerChecker(dbu)
> 
> myServer =
> twisted.application.internet.TCPServer(8080,pb.PBServerFactory(p))
> myServer.setServiceParent(myService)



this is really simple and is explained in the HOW TO multiple protocols.

short story is you have your Factories delegate to the same service.




-- 
If you don't know what you want, you probably need a nap.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20050616/f7f5967a/attachment.htm 


More information about the Twisted-Python mailing list