note 22152 deleted from function.fsockopen by sniper

From: Date: Thu, 13 Feb 2003 00:46:38 +0000
Subject: note 22152 deleted from function.fsockopen by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-43851@lists.php.net to get a copy of this message
PHP Version 4.2.0/WIN32 <?PHP $iptoopen="127.0.0.1"; $porttoopen = 2593; $ltime=time(); $connection = fsockopen ($iptoopen, $porttoopen, &$errno, &$errstr, 1); if (!$connection){ echo "Can not Connect: ($errno)-$errstr"; }else{ fputs($connection, "\n"); socket_set_timeout($connection, 1, 1); echo "Ok I'am Connected to the port!"; } $htime=time(); $ttime=($htime-$ltime); echo "Time =$ttime Seconds!"; echo "Done! Closing port!"; fclose ($connection); ?> If the port does not respond, it takes about 21 seconds to come back! Shouldnt it be 1 second? That is what is stated in the "fsockopen"?

« previous php.notes (#43851) next »