Ian - 2017-12-28 14:38:00 -
In reply to message 1 from Maureen M
It's not an infinite loop. It's caused by the script timing out while fgets is waiting for a response (and verion.net isn't sending one).
Using fread in function GetLine in email_validation.php solves the problem *provided* the timeout is also set low enough (there are multiple calls to this function via VerifyResultLines so they can add up).
I'm getting satisfactory results with:
$validator->timeout=5; (in test_email_validation.php)
and the following replacement function (in email_validation.php):
Function GetLine($connection)
{
$data=fread($connection,100); // because fgets does not respect socket_set_timeout
$lines=explode("\n",$data);
$line=trim($lines[0]);
if($line)
{
if($this->debug) $this->OutputDebug("S $line");
return($line);
}
return(0);
}