NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: CyberFerret on February 22, 2008, 12:46:35 AM
-
Hi all,
I have written a simple, manual NetWebPage using NetTalk which does some database operations and then returns the data as a straight XML packet. eg:-
Loop recordptr = 1 to Records(somefilename)
Get(somefilename, recordptr)
packet = clip(packet) & '<tr>' & rec:somefieldsinhtmlformat & '</tr>'
End
With smaller data sets, the returned data comes up beautifully. Note: We are using Prototype to do an Ajax.Updater call to this routine and embed the returned data into the calling web page table.
The problem is with larger data sets, the data gets 'chopped' after so many lines. I am assuming this is because we are reaching the limit of what the 'packet' variable can hold.
The question is, how can we break this up into multiple packets in the procedure and return the data piecemeal?
Thanks,
Devan
-
Hi Devan,
I think the limit at the moment for a single "packet" is 16K. (This number doesn't actually mean anything - windows, routers, whatever, can all break packets apart and put others together. So 1 packet out does not necessarily mean 1 packet in the other side).
However you page can have as many packets as you like in it.
So all you need to do, is every so often, do a send.
In a NetWebPage this will most likely be
do SendPacket
ie your code can become
Loop recordptr = 1 to Records(somefilename)
Get(somefilename, recordptr)
packet = clip(packet) & '<tr>' & rec:somefieldsinhtmlformat & '</tr>'
do SendPacket
End
cheers
Bruce
-
Bruce,
Your suggestion worked PERFECTLY! I am continually amazed at the architectural consideration that has gone into NetTalk which makes things like this so easy to accomplish...Heck, who needs Ruby on Rails when you have Clarion on NetTalk?? :) :) :)
Cheers,
Devan