I am getting some sockreads truncated in a script.
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>
. And here is what my script returns from the same page -
Quote:
<A NAME='1991401'></A> Definition</span></T
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
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!


-
Just because it never happened doesn't mean it isn't true.