[Twisted-Python] Multicast XMLRPC

glyph at divmod.com glyph at divmod.com
Thu Aug 24 13:48:56 EDT 2006

On Thu, 24 Aug 2006 12:54:38 -0400, "Chaz." <eprparadocs at gmail.com> wrote:
>Chaz. wrote:

>It seems my one problem was that in the definition of my class...

Those classes are not really meant to be used by subclassing.

>That solved my immediate problem, though I did find out that XMLRPC does in 
>fact assume that you have a connection oriented protocol underneath it. Now 
>I will just have to fix that problem.

How do you propose to "fix" that property of XMLRPC?  It's not really a "problem", in that it's *defined* to use not only a connection, but an HTTP connection at that.  From the XML-RPC specification: "An XML-RPC message is an HTTP-POST request."

There is Jabber-RPC, which indicates how you might make an XMLRPC-*like* protocol over some other transport, but in your case that still requires a reliable multicast message delivery layer (a monumental task by itself).

What is the application you are writing this for?

>Also for those of you that said you can't do:
>I would suggest you are wrong. In fact that is exactly how subclassing works 
>in Python. But that is for another time.

You misunderstood.  I assure you they were correct, but that isn't what they said.  Simplified, here is what you did:

>>> class A:
...  def __init__(self):
...   print self
>>> class B:
...  def __init__(self):
...   A.__init__(self)
>>> B()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "<stdin>", line 3, in __init__
TypeError: unbound method __init__() must be called with A instance as first argument (got B instance instead)

This is, in fact, illegal, and that is why you got the exception that you did.

This is all moot, however, since you shouldn't use TCPServer with subclassing :).

More information about the Twisted-Python mailing list