[Twisted-Python] Multicast XMLRPC

Jean-Paul Calderone exarkun at divmod.com
Thu Aug 24 12:09:27 EDT 2006


On Thu, 24 Aug 2006 11:49:49 -0400, "Chaz." <eprparadocs at gmail.com> wrote:
>I have a XMLPRC client that works well under TCP and I am now trying to get 
>it to work under Multicast conditions.
>
>Here is the "TCP" code I used:
>
>class StorageService(internet.TCPServer):
>     def __init__(self,tcpPort,configInfo):
>         r = StoragePeer(configInfo)
>         xmlrpc.addIntrospection(r)
>         internet.TCPServer.__init__(self,tcpPort,server.Site(r))
>
>I changed the call to TCPServer to:
>
>
>class StorageService(internet.TCPServer):
>     def __init__(self,tcpPort,configInfo):
>         r = StoragePeer(configInfo)
>         xmlrpc.addIntrospection(r)
>         internet.MulticastServer.__init__(self,tcpPort,server.Site(r))
>
>I thought this would work since, but it doesn't. What I get returned is the 
>following error message:
>
>
>Failed to load application: unbound method __init__() must be called with 
>MulticastServer instance as first argument (got StorageService instance 
>instead)
>
>
>Does anyone know what I am doing wrong?

The immediate mistake you are making is trying to call an unbound method
from one class with a self argument which is an instance of an unrelated
class.  This is not allowed in Python.

The overall mistake you are making is trying to use XML-RPC over multicast.
This does not work.  Perhaps something like XML-RPC could be made to run
over multicast, but it would be a much larger undertaking than just using
MulticastServer in place of TCPServer.

Jean-Paul




More information about the Twisted-Python mailing list