NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: HalfBubble on January 10, 2012, 09:13:41 AM

Title: Returning a big packet (bigger than 16KB)
Post by: HalfBubble on January 10, 2012, 09:13:41 AM
Converting an old file-drop system into a "compatible" web system.

I have a big response to send back that looks like:


HTTP/1.0 200 OK
ContentType: text/xml; charset=utf-8
Content-Length: 16384

<?xml version="1.0"?><TeeQueryResponseFile><ScheduleResponse>
<SRUniqueID>1</SRUniqueID>
<SRDate>20120111</SRDate>
<SRReturn></SRReturn>
<TeeTimes>
<TeeTime><CourseCode>CT</CourseCode><Time>09:30</Time><Hole>1</Hole><Open>3</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>06:28</Time><Hole>1</Hole><Open>2</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>13:42</Time><Hole>1</Hole><Open>1</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>17:12</Time><Hole>1</Hole><Open>4</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>15:06</Time><Hole>1</Hole><Open>1</Open></TeeTime>
<TeeTime><CourseCode>CT</CourseCode><Time>16:02</Time><Hole>1</Hole><Open>2</Open></TeeTime>

and so on and so on for ever and ever amen.

Naturally, it's longer than 16KB.

The code to return it looks like:


TQ                   PROCEDURE  (NetWebServerWorker p_web)
loc:x          Long
packet         String(NET:MaxBinData)
packetlen      Long
CRLF           String('<13,10>')
NBSP           String('&#160;')
loc:options    String(OptionsStringLen)  ! options for jQuery calls
Loc:User            long
ThisSecwinAccess    string(252)

  CODE
  GlobalErrors.SetProcedureName('TQ')
  p_web.SetValue('_parentPage','TQ')
  p_web.publicpage = 1
  if p_web.sessionId = 0 then p_web.NewSession().
  IF FALSE
  do Header
  packet = clip(packet) & p_web.BodyOnLoad(p_web.Combine(p_web.site.bodyclass,'PageBody'),,p_web.Combine(p_web.site.bodydivclass,'PageBodyDiv'))
  do Footer
  packet = clip(packet) & p_web.Popup()
     END
  packet = WebQuery(p_web.GetValue('xml'))
  packet = 'HTTP/1.0 200 OK <13,10>ContentType: text/xml; charset=utf-8<13,10>Content-Length: ' & LEN(CLIP(packet)) &  '<13,10><13,10>' & packet

  do SendPacket
  GlobalErrors.SetProcedureName()
  Return

So it looks like I need to send it in more than one packet?
Title: Re: Returning a big packet (bigger than 16KB)
Post by: bruce2 on January 10, 2012, 12:34:16 PM
Correct, just set packet to say 16k at a time, and call do sendpacket.