Querying Half Life Servers

From: Date: Wed, 23 Jan 2002 17:08:19 +0000
Subject: Querying Half Life Servers
Groups: php.general 
Request: Send a blank email to php-general+get-81717@lists.php.net to get a copy of this message
use the folowing code to query the status of Quake II Servers. Everything goes rigth, if the server is up, but if it's down, there isn´t no timeout for the socket and it dont stop opening the web. There is one timeout for sockets??¿?, i didnt find it on the funtion list. Any idea about other to do the query?¿¿?¿ $recordset = mysql_query($query); while ($row_demos=mysql_fetch_array($recordset)) { $address = $row_demos["ip"]; $service_port = $row_demos["port"]; $socket = socket_create(AF_INET, SOCK_DGRAM, 0); $result = socket_connect($socket, $address, $service_port); if ($result < 0) { echo "connect() failed.\nReason: ($result) \n"; } $in = "ÿÿÿÿgetstatus"; socket_write($socket, $in, strlen($in)); $out = socket_read($socket, 512);

« previous php.general (#81717) next »