RobotGirlOwnedAndControlled Posted January 18 Share Posted January 18 I am trying to send up to 10K characters between two objects in SL via HTTP. Using PUT or POST I can send any amount of data (in the body), limited only by the script memory. Data in a header is limited to 255 bytes. However it appears the most data I can RECEIVE either in http_response or http_request is 2048 bytes. Is this correct, or is there a way around this limitation? Currently I am looking at sending the data in batches to get around this limitation, but it would be great if I could do it all in one go. Having said all that - in this current format it takes 20 seconds for SL to load 150 lines from a notecard... and then just 3 seconds to send them via http! Also - I know that Mono uses 2 bytes per character. So 2048 bytes of data received would be 1024 characters. But I am receiving 2048 characters. Does LSL send characters in a different format to Mono, so that it only uses one byte per character? It seems so to me. Thank you in advance for any help. Link to comment Share on other sites More sharing options...
Qie Niangao Posted January 18 Share Posted January 18 (edited) 1 hour ago, RobotGirlOwnedAndControlled said: it takes 20 seconds for SL to load 150 lines from a notecard Have a look at this new function: https://wiki.secondlife.com/wiki/LlGetNotecardLineSync (in a release that was supposed to go out to all RC simulator channels this week, although I'm not sure it made it). Also, I only use http when I really have no choice, to avoid getting entangled in some very unintuitive throttle behavior. If it were me, I'd take advantage of the fact Experience KVP scripts aren't land-scope limited anymore, and simply read the notecards into that huge KVP persistent store. Maybe pass a semaphore by http if polling by the recipient seems too ugly (and if I can be sure of some form of stable addressing). The approach inherently supports broadcast, too, but does require an Experience. (ETA: Just in case, you know you can read notecards "remotely" by their UUID, right? That only works if you can get their UUID, though. And only relevant if notecards are the actual intended source of the data to be sent.) Edited January 18 by Qie Niangao 2 Link to comment Share on other sites More sharing options...
Quistess Alpha Posted January 18 Share Posted January 18 31 minutes ago, Qie Niangao said: I'd take advantage of the fact Experience KVP scripts aren't land-scope limited anymore, Oh really? how recent is that and has it reached non-rc channels? Link to comment Share on other sites More sharing options...
Qie Niangao Posted January 18 Share Posted January 18 (edited) 15 minutes ago, Quistess Alpha said: Oh really? how recent is that and has it reached non-rc channels? Yeah, that's grid-wide now. It's been long enough it'll take some digging to track down which release it was in, but… 3Q23? maybe 4Q? ETA: Here we go: Quote On Tuesday, September 19th, SLS Main channel was updated to simulator update 6113592855 (aka “Dog Days”), previously on the majority of the RC channels. This update includes: The unbinding of the Experience KVP database read / write functions from land (users will still require an Experience to access the KVP database). from Inara Pey's wonderful Modemworld blog. Edited January 18 by Qie Niangao 1 1 Link to comment Share on other sites More sharing options...
Quistess Alpha Posted January 18 Share Posted January 18 40 minutes ago, Qie Niangao said: Just in case, you know you can read notecards "remotely" by their UUID, right? That only works if you can get their UUID, though. And only relevant if notecards are the actual intended source of the data to be sent. I'm sure you know, but might be important to add that a notecard's UUID changes every time it is modified; so 'remote reading' either requires some way to track the UUID for anyone who might want to read it (KVP would be a good intermediary) or accept that the data in the notecard can never be changed if it is 'hard-coded' in the script. 1 1 Link to comment Share on other sites More sharing options...
elleevelyn Posted January 18 Share Posted January 18 4 hours ago, RobotGirlOwnedAndControlled said: Also - I know that Mono uses 2 bytes per character. So 2048 bytes of data received would be 1024 characters. But I am receiving 2048 characters. Does LSL send characters in a different format to Mono, so that it only uses one byte per character? It seems so to me. on this part LSL script data uses UTF-16 characters. llHTTP... uses UTF-8. Linkset data also uses UTF-8. The conversion is done automatically for us when we use 7-bit ASCII characters in our data then we get what you observing. 7-bit ASCII char = 2 bytes UTF-16 = 1 byte UTF-8 1 Link to comment Share on other sites More sharing options...
RobotGirlOwnedAndControlled Posted January 18 Author Share Posted January 18 Thank you all so much for your help!! elleevelyn - I guessed the answer was something like that, thanks for confirming my (scant) understading. Qie and Tessa - now I'm facepalming - NO! I didn't know I could access the notecard directly using the UUID, although I should have realised as I do it regularly with textures and sounds. This DOES make things easier. I know nothing about experiences, having never needed to use them. But I do now have an external webserver set up - where I link object URLs to persistent IDs that each object maintains. I am using this for objects to communicate with each other across sims... so my giver object can just send the UUID of the relevant notecard to the receiver object and then the receiver can load it using this new llGetNotecardLineSync function. Will be experimenting with this now... Thank you all - this has been really helpful and I very much appreciate it. 2 Link to comment Share on other sites More sharing options...
Wulfie Reanimator Posted January 18 Share Posted January 18 22 minutes ago, RobotGirlOwnedAndControlled said: so my giver object can just send the UUID of the relevant notecard to the receiver object and then the receiver can load it using this new llGetNotecardLineSync function. Keep in mind that notecards never change. When you edit a notecard, you're creating a new notecard with a new UUID. If you use the old UUID, you'll be reading the old contents. 1 1 Link to comment Share on other sites More sharing options...
Innula Zenovka Posted January 18 Share Posted January 18 11 hours ago, RobotGirlOwnedAndControlled said: Data in a header is limited to 255 bytes. However it appears the most data I can RECEIVE either in http_response or http_request is 2048 bytes. You can increase the maximum length of body to receive in the http_response event by setting, in the llHTTPRequest call, HTTP_BODY_MAXLENGTH,16384 2 Link to comment Share on other sites More sharing options...
RobotGirlOwnedAndControlled Posted January 18 Author Share Posted January 18 1 hour ago, Wulfie Reanimator said: Keep in mind that notecards never change. When you edit a notecard, you're creating a new notecard with a new UUID. If you use the old UUID, you'll be reading the old contents. Yep - got that thanks. That will be fine - if I want to re-load it again I can. Link to comment Share on other sites More sharing options...
RobotGirlOwnedAndControlled Posted January 18 Author Share Posted January 18 52 minutes ago, Innula Zenovka said: You can increase the maximum length of body to receive in the http_response event by setting, in the llHTTPRequest call, HTTP_BODY_MAXLENGTH,16384 AAHHAAA!!! Thanks Innula, I'll be experimenting with that. Although I don't think I'll need it now in this particular case, it may come in handy later. Link to comment Share on other sites More sharing options...
RobotGirlOwnedAndControlled Posted January 18 Author Share Posted January 18 11 hours ago, Qie Niangao said: Have a look at this new function: https://wiki.secondlife.com/wiki/LlGetNotecardLineSync (in a release that was supposed to go out to all RC simulator channels this week, although I'm not sure it made it). Also, I only use http when I really have no choice, to avoid getting entangled in some very unintuitive throttle behavior. If it were me, I'd take advantage of the fact Experience KVP scripts aren't land-scope limited anymore, and simply read the notecards into that huge KVP persistent store. Maybe pass a semaphore by http if polling by the recipient seems too ugly (and if I can be sure of some form of stable addressing). The approach inherently supports broadcast, too, but does require an Experience. (ETA: Just in case, you know you can read notecards "remotely" by their UUID, right? That only works if you can get their UUID, though. And only relevant if notecards are the actual intended source of the data to be sent.) Looks like this new function isn't working yet... my script won't recognise it. Maybe it will be out soon... 1 Link to comment Share on other sites More sharing options...
Shatter Roundel Posted January 19 Share Posted January 19 Just a thought for you linkset datastore can contain up to 131072 bytes (128 KiB) of data llLinksetDataWrite(line,notecardinfo) and then llLinksetDataRead(line,notecardinfo) without the slow reading notetcard 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now