$fp = fsockopen("IP ADRESI", "PORT", $errno, $errstr, 30);

 if (!$fp) {
 echo $errstr;
 }