LlHTTPRequest Pro Tip(s)

From Second Life Wiki
Revision as of 19:05, 15 April 2010 by Vegas Silverweb (talk | contribs) (Created page with 'Pro Tip! llHTTPRequest can return null key. Means you're llHTTPRequest-ing too fast, generally. To keep it reliable, you need to do something like this: <lsl> key req; ...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Pro Tip!

llHTTPRequest can return null key. Means you're llHTTPRequest-ing too fast, generally. To keep it reliable, you need to do something like this:

<lsl>

    key req;
        while(NULL_KEY == req=llHTTPRequest("http://example.com/",[],"")) {
           llOwnerSay("uh oh throttle");
           llSleep(5.0);
           
           }

</lsl>

The sleep should probably be longer, perhaps 20 seconds. Even better, defer the HTTP request for 10 or 20 seconds with a timer so your event queue can be serviced while the llHTTPRequest throttle is in effect.