Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Xml-rpc

Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
03-23-2005 07:35
I'm fully prepared to admit my ignorance here, but I've been asked to stream something outside of SL using RPC if I can.

I can't send directly, and although that's frustrating I do understand the reasons. So, the next question would be, if I receive a suitably phrased request, can I reply to it several times?

If I want to send a 1,000 character reply, but can cope with it as 4 250 character replies, do I need 4 RPC queries to reply to it?

I've looked at the llEmail option, but for some reason when I was testing them yesterday llEmail wasn't working for some reason, although the same script had worked perfectly when on my land the day before. If there some sort of tie to whose land you are sending it from? All of the obvious options to me (like scripts being enabled) were OK...
Apotheus Silverman
I write code.
Join date: 17 Nov 2003
Posts: 416
03-23-2005 09:25
Each xml-rpc request is a single transaction, so no you cannot reply 4 times without calling it 4 times. If it was able to reply many times by only calling it once, it would be similar to having a function that you call once and it returns 4 times before exiting... it just isn't possible (under most circumstances).

However, your calling application can do something like:

CODE
// c#.net code example
string rpcData = "";
bool done = false;

// Loop until we get a single line with only a period (similar to SMTP data)
// or until something goes wrong
while (!rpcData.EndsWith("\n.\n")) {
try {
rpcData += GetRpcData();
}
catch {
break;
}
}


Your in-world object would need to understand how to continue replying until it has sent all of its data.

However seeing as how this code is right off the top of my head, untested, and probably not completely thought-through, please take my advice with a grain of salt. In fact, someone else on this board can probably provide a much better example than this. :)
_____________________
Apotheus Silverman
Shop SL on the web - SLExchange.com

Visit Abbotts Aerodrome for gobs of flying fun.
Adam Zaius
Deus
Join date: 9 Jan 2004
Posts: 1,483
03-23-2005 09:52
Email is the way to go for anything bigger than a short request;

there has been some disruption with the servers (first major disruption in about 6 months really), send an IM to Andrew Linden with the name of the sim is was broken in, and he should be able to get it fixed quickly.

Personally, if you decide to use email for large projects, make sure to build your own packeting system in; for reliable transfer include a ordering system (so messages arriving out of order can be patched up together) and a receipt system.

A way to do ordering simply on the LSL side is to have the subject equal to the message index, then you can use llGetNextEmail((string)num,"";); to recieve the next message in order.

-Adam
_____________________
Co-Founder / Lead Developer
GigasSecondServer