I ma having the hardest time getting this working right
i have a script that shows the status of a game server and well it works but only if he server is online otherwise the script times out i have tried tons of stuff but please post it any ways cause i might have done it wrong.
well here the code
function parseServerstatHL()
{
$fp = fsockopen("udp://" .$this->caddress, $this->cport, $errno, $errstr, 2);
if (!$fp)
{
//unable to connect to host
$this->serverinfo["name"] = "<font color=\"#FF0000\">$this->caddress</font>";
$this->serverinfo["address"] = $this->caddress;
$this->addError("parseServerstatHL() had an error connecting to " . $this->caddress . ":" . $this->cport . "($errno - $errstr)");
}
else
{
fwrite($fp,$this->commands[$this->cgametype]["Serverinfo"]);
// Get rid of the header
$header = fread($fp,5);
// Get server address and Port
$do = true;
$result = "";
while($do)
{
$str = fread($fp,1);
$result .= $str;
if ($str == "\x00") $do = false;
}
$this->serverinfo["address"] = $result;
........
Thank you in asvanced