I don't have much to say in either direction, since I have never used the
builtin xml-rpc in my own server/client solution. But I think I used it
once to connect to an instance of supervisor (the python-based process
manager), which does expose an xml-rpc endpoint so that you can control it.
Seems like xml-rpc is probably a lower performance solution that is good
when you just need to send less frequent calls. Since it uses xml and makes
httprequests, it has extra overhead in both the connection and the
protocol.
Also, I think the builtin server in the python standard lib might be there
for lower performance needs. The server isn't a serious production grade
and most likely handles a single request at a time. I believe it also fully
tears down the connection after each call, as opposed to solutions that
could use keep-alive.

But it probably works just fine for the situation you outlined, where you
are sending control commands to a local Maya. I doubt you would want to
stand up a server and hit it with 10 clients.

On Thu, 21 May 2015 3:11 AM Marcus Ottosson <[email protected]> wrote:

> Does anyone have experience with it? What are your thoughts, compared to
> other forms of RPC?
>
>    - https://docs.python.org/2/library/simplexmlrpcserver.html
>
> I found it hidden away amongst the default Python libraries and am quite
> astounded by it’s simplicity.
>
> # From within Mayafrom SimpleXMLRPCServer import SimpleXMLRPCServerimport 
> threading
> from maya import cmds
>
> server = SimpleXMLRPCServer(("127.0.0.1", 8000))
> server.register_function(cmds.createNode)
>
> t = threading.Thread(target=server.serve_forever)
> t.daemon = True
> t.start()
>
> And then, from a terminal.
>
> >>> import xmlrpclib>>> proxy = 
> >>> xmlrpclib.ServerProxy("http://127.0.0.1:8000/";)>>> 
> >>> proxy.createNode("mesh")'polySurfaceShape1'
>
> Resources:
>
>    - pymotw1
>    
> <http://pymotw.com/2/SimpleXMLRPCServer/index.html#module-SimpleXMLRPCServer>
>    - pymotw2 <http://pymotw.com/2/xmlrpclib/>
>
> ​
> --
> *Marcus Ottosson*
> [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBOaQfQ0k2_dLavXb0zDOOR6%2Bt%2Bb%3DpjWz7mMdrBWKDvTw%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBOaQfQ0k2_dLavXb0zDOOR6%2Bt%2Bb%3DpjWz7mMdrBWKDvTw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2p5vYZTsvgO7Kysz3tSqGGYho6gzbGZ%3Don%2BHnewwYimA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to