webmining and tcp4u

new topic     » topic index » view thread      » older message » newer message

I discovered something, but i know not what, anyone have any ideas?

global function ReadServer()
sequence buffer
buffer = ""
sock_receive = ""
while tcp4u_is_data_avail(sock) do
   sock_receive = tcp4u_receive(sock,1,0)
   if sock_receive[1] > 0 then buffer &= sock_receive[2] end if
end while
return buffer
end function -- readserver

if i use this line:
  sock_receive = tcp4u_receive(sock,1000,0)
and return sock_recieve[2] (if sock_recieve[1] is good), it will occasionally 
overrun the tcp4u buffer, returning bits of the last page, and re-arranged bits 
of the new page. Or not returning the whole page, even with the calling loop 
below:

     TheWebPage &= ReadServer()
    -- sleep(1)
  end while

unless i un-comment the sleep(1). I know the buffer is being overrun in tcp4u, 
because both ServerNeedsAttention() and not 
middle of the current page. I puts() the page to the harddrive for forensics, 
which is how i know what TheWebPage is being set to after these crashes.

Other than keep doing what i fudged up to keep working, anyone have any 
ideas?

Kat

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu