Jump to content

HTTP Communication Question - Multiple Responses???


Malestorm1488303118
 Share

You are about to reply to a thread that has been inactive for 4075 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi --

I have HTTP Communication working nicely between my scripts and my server, using PHP.    However, I now have a sigle script HTTP request that results in a lot of data coming back from the server.  

>>> Is the any way my one script request can result in multiple server responses, so that the data from each response is recieved in separate http_response events , or even by separate scripts?

Currently when I try send out separate responses from my PHP program, my script is getting all the data packed together, in one http_response event, even though it is sent using separate RETURN statements of different php functions.

Many thanks for considering this question in advance.

Link to comment
Share on other sites


Malestorm wrote:

>>> Is the any way my one script request can result in multiple server responses, so that the data from each response is recieved in separate http_response events , or even by separate scripts?

The way some HTTP scripts work is by using llParseString2List to break at <br/> or other similar points. That way your webpage displaying:-

<html>Data1<br/>Data2<br/>Data3</html>

 

Now looks like lBody = [Data1,Data2,Data3], which you can cycle through using a for loop.

To divide the processing at this point is fairly easy, you can use link messages (within the for loop, llMessageLinked(LINK_SET,i,llList2String(lBody,i),NULL_KEY);) or other mechanics to get the data to separate for processing in other scripts.

Link to comment
Share on other sites

HTTP communication is simple:  request an an response. I you use several echo or print commands in an response, the result will still be one response.  That should answer the quostion for separate http_responses.

As for several scripts listening for the responses to the same request: All scripts in a prim that sent the request can listen for the response.

To advice you how to best go about your problrm, it wiuld be good to know a little more about what your problem is.

Link to comment
Share on other sites

It is possible to send several HTTP responses for a single request, either intentionally or as a bug, especially in multithreaded Java server.

Whether or not the LSL http_response event would only fire on the first response and ignore the rest I simply don't know.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4075 days.

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
 Share

×
×
  • Create New...