Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

XML-RPC confusion

Starbuckk Serapis
Registered User
Join date: 10 Nov 2006
Posts: 114
01-28-2007 12:21
I am trying to understand XML-RPC, its benefits, and effectiveness. As I am understanding, I should be able to use this to communicate between in-world objects that are great distances apart. Now I know this could be done through email, but there is a delay penalty for email that apparently is not so severe with XML-RPC. But, I am not finding good practical examples, and am wondering if i am misunderstanding.

So, here is a simple question and hopefully someone with some expertise on this could respond if I am correct, and maybe with a practical solution that would benefit all of us :)

Lets say I have a sign in a far off region. I want to change the floating text on that sign (maybe a few signs even) remotely. But don't want to go to the region to do it. Now I know it culd be done through an email. And probably through http requests. But can it not also be done through XML-RPC communication? And, would that go direct object to object, or would there have to be a web page intermediary?

Could someone post an example of this? THis I think would put it into perspective for eveyrone. THanks in advance!
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
01-28-2007 13:44
With LSL, objects cannot initiate XML-RPC requests, only respond to them. So, there is no native way to use XML-RPC for direct object-to-object communication.

Of course, one can send custom HTTP messages to an external server, which in turn send XML-RPC messages to objects. In theory, it's possible to write your own bi-directional XML-RPC layer on top of LSLs http functions, but perhaps not worth the effort.

-peekay
Starbuckk Serapis
Registered User
Join date: 10 Nov 2006
Posts: 114
01-28-2007 17:31
ok well that helps. Thanks.

So, I could do an httprequest to a server, which would then send xml-rpc to the designated object. Given the built in 20 second delay on llEmail, would this approach be quicker? Assuming we have a well performing web page of course....
Arachnid Baxter
Registered User
Join date: 8 Jan 2007
Posts: 44
01-28-2007 17:47
Definitely quicker. As Peekay pointed out, though, it ought to be possible to write an XMLRPC client in LSL - XMLRPC is a fairly simple protocol. Possibly the only reason nobody appears to have done that is because of memory issues dealing with XML.
Rifkin Habsburg
Registered User
Join date: 17 Nov 2005
Posts: 113
01-28-2007 18:00
Before you get started using XMLRPC, you should be warned: it's experiencing severe problems right now.

The same database load that is straining teleports and Find is affecting XMLRPC. The problem is, every RPC request in the entire grid is funnelled through a single machine. When that machine gets overloaded, RPC goes down, and any RPC requests initiated from outside the grid simply time out (and get lost).

If you need every request to get through with high reliability, you should think twice before using RPC.
_____________________
Procyon Games: makers of Can't Stop, En Garde, Take it Easy, Danger Zone and Frootcake.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
01-29-2007 01:25
From: Starbuckk Serapis
ok well that helps. Thanks.

So, I could do an httprequest to a server, which would then send xml-rpc to the designated object. Given the built in 20 second delay on llEmail, would this approach be quicker? Assuming we have a well performing web page of course....


The 20 second delay is only in the sending script easily overcome by using a proxy.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
01-29-2007 09:33
There are also some severe limitations to the XML-RPC implementation, as I noted in the old wiki. Hence:

From: someone
The current implementation of XML-RPC only allows ONE request to be queued on the front-end server (xmlrpc.secondlife.com) at a time. Any additional requests to the same data channel overwrite any pending one. This has serious ramifications for the design of XML-RPC communications where the in-world object could receive requests faster than it can respond to them. In addition, the 3-second delay in llRemoteDataReply exacerbates this problem even more.

The observed issue is this: if you send multiple quick requests to an in-world object via XML-RPC, one which is scripted to perform some processing and then return a response (via llRemoteDataReply), there is a potential for earlier requests to get lost on the front end server (they still should generate remote_data events, though), and have the response meant for an earlier request end up being passed back to a later one, while the earlier requests will time out back at your external application.

As a result, if you intend to do any serious work with XML-RPC, you will have to design your external client application to manually serialize all requests to each individual RPC channel. That means you have to wait for a response from the previous request before you attempt to send the next one. If you don't care about receiving responses, then this problem is not an issue, as all requests seem to get passed on to the script, regardless of the queueing issue.

Also note that there is NO way to get around the 3-second delay for llRemoteDataReply; you cannot use the multiple-slave-comm-script trick, because XML-RPC channels are *script-specific*, NOT *object-specific*.
Daisy Rimbaud
Registered User
Join date: 12 Oct 2006
Posts: 764
01-29-2007 10:16
What's the best way to activate a script in a remote sim, then? Would you need a script that had coded into it the key of the remote object?
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
01-29-2007 13:01
Yes, you would have to use llEmail, and would have to "know" the key to the receiver (ie, hard-coded, stored in a config notecard, etc).

An XML-RPC solution is possible, but requires a an external webserver to act as an intermediary.