Hi
Here is my code :
<?php
$status=0;
if(isset($_GET['host']) && isset($_GET['port'])){
try{
$fp = @fsockopen ($_GET['host'], $_GET['port'], $errno, $errstr, 5);
if ($fp) {
$status=1;
fclose($fp);
}
}
catch(Exception $ex){
}
}
echo $status;
?>
Here the timeout parameter is not working.
Anybody please help me in this.
Regards
Rahesh
timeout parameter of fsockopen function not working?
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: timeout parameter of fsockopen function not working?
How do you know it's not working???
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: timeout parameter of fsockopen function not working?
its taking more than 5 seconds to get response..
Re: timeout parameter of fsockopen function not working?
Try this first:
Code: Select all
ini_set('default_socket_timeout',5);