Truncated sockreads - 20/01/09 04:41 AM
I am getting some sockreads truncated in a script.
The following line of HTML code is from a web site. And here is what my script returns from the same page - It's a lot shorter. Now, for some activities size isn't important but I think it does matter in this case. Furthermore, it doesn't always happen. Sometimes the full HTML line is successfully retrieved.
My question, then, is a general one. Is there a method to detect a 'broken' sockread? I have modified the code from the /sockread example in the help file eg
Thanks for listening!
The following line of HTML code is from a web site
Quote:
<A NAME='1991401'></A> Definition</span></TD><TD ALIGN='right' VALIGN='baseline' WIDTH='5%'><SPAN class='fieldValue' style='font-size: 80%; font-weight: bold;'>1.</SPAN></TD><TD ALIGN='left' VALIGN='baseline' WIDTH='70%'><span class="fieldValue" STYLE="font-weight: normal;">a building in which people, esp. members of a family, reside.</span></TD></TR>
Quote:
<A NAME='1991401'></A> Definition</span></T
My question, then, is a general one. Is there a method to detect a 'broken' sockread? I have modified the code from the /sockread example in the help file eg
Code:
on 1:sockread:testing:{ if ($sockerr > 0) return :nextread sockread %temp if ($sockbr == 0) return if (%temp == $null) %temp = - echo 4 %temp ### my code goes here ### goto nextread }
Thanks for listening!