I have been using plcnut's web server code he provided to handle HMI functions and JSON requests. It is working great with a few tweaks for my situation. In one of the requests I need to serve, the JSON string I will return will be based on the number of elements filled in a memory block and could be anywhere from 200 to 15,000 chars in length. I'd like to build the web response on the fly and send out each ~1,024 char block in a for loop. Below is some rough pseudo code of what I have in my stage. Unfortunately only the first block is sent. I am guessing I need to do something to make sure the TCP device I am streaming to isn't still working on the prior request but am not sure. I am hoping one of you can point me in the right direction or show me where I am being dumb. Thanks in advance.
for(i = 0; i < numRecords; i++)
curBlock = "{ id: i, state: 'Running', description: 'lorem ipsum...',...}";
streamout(curBlock);
next