hi all,
i tried to write a script, which check if a Server is online or offline.
The servers are build by friends for onlinegaming voicesoftware (Battlecom
or Gamevoice).
My Script works fine for Battlecom Servers, because there i only have to
check if the server
is online on a TCP Port(47624).
But if i have to check a Gamevoice Server, i must use udp-port 9110. Which
Ip i enter, the server is always online. I cant find the mistake.
Can u help??
Here the Script:
$voiceport2 = 9110;
$voiceprot2 = "udp://";
$voiceip2 = "80.133.16.93";
if(vservertest($voiceip2, $voiceport2, $voiceprot2) == 1)
{
$vstatus2 = "ONLINE";
}
else
{
$vstatus2 = "OFFLINE";
}
function vservertest($vhostadress, $vhostport, $voiceudp)
{
if($voiceudp != "") //only for check if it is a BC or GV Server
{
$vhostadress = $voiceudp.$vhostadress;
$fp = fsockopen($vhostadress, $vhostport, &$errno, &$errstr, 10);
// echo "$fp\n";
// echo "$errno\n"; only for testing
// echo "$errstr\n";
if($fp)
{
$result = 1;
// echo "TEST: $vhostadress\n";
fclose($fp);
return $result;
}
else
{
$result = 0;
#--fclose($fp);
return $result;
}
}
Thx 4 ur help,
Marc Werther
Student
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php