12.02.2011, 10:46
Summary: I've been trying to use the sockets code from the sa-mp query script and for some reason it won't work.
Info: DB_SERVER is a DNS (EX: xxx.gotdns.com)
Problem: No matter what status the server has (online/offline) it only echoes 'Online'.
Anyone here that might tell me what is wrong?
PS: Just started working with sockets...
PHP код:
$fp = @fsockopen('udp://'.DB_SERVER, 7777, $errno, $errstr, 0.05);
if(!$fp) echo 'Offline';
else echo 'Online', close($fp);
Problem: No matter what status the server has (online/offline) it only echoes 'Online'.
Anyone here that might tell me what is wrong?
PS: Just started working with sockets...