Menu
Hello,
I have this script to test if servers are online or down.
Actually it will test each ip address sequentially…Is it possible to speed it up with multithreading?
Thx
[code=php]<?
include (‘dbconnect.php’);
$sql=mysql_query(“SELECT ip, port FROM listeip”)or die(mysql_error());
while($data = mysql_fetch_array($sql))
{
$fp = fsockopen(”.$data[‘ip’].”, ”.$data[‘port’].”, $errno, $errstr, 20);
if (!$fp)
{
$delete= mysql_query(“DELETE FROM listeip WHERE ip='”.$data[‘ip’].”‘”) or die(‘Problem:’.mysql_error());
}
fclose($fp);
}
?>