note 58970 added to function.gethostbyaddr
| From: | respaldodatgmaildotcom at osu1 dot php dot net | Date: | Tue, 22 Nov 2005 18:28:36 +0000 |
| Subject: | note 58970 added to function.gethostbyaddr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-98937@lists.php.net to get a copy of this message | ||
There is a small flaw in the timeout implementation of King Macro's very useful sockets-based
function gethostbyaddr_timeout() below.
The parameters for socket_set_timeout, an alias for stream_set_timeout(), are like this:
( resource stream, int seconds [, int microseconds] )
So if you want to use his parameters, and assuming the $timeout param should be in milliseconds, you
could first convert to microseconds
$timeout *= 1000;
And then change the socket_set_timeout so you have seconds and microseconds along these lines:
@socket_set_timeout($handle, floor($timeout/1000000), $timeout%1000000);
----
Manual Page -- http://www.php.net/manual/en/function.gethostbyaddr.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58970
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58970&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58970&report=yes
Search -- http://master.php.net/manage/user-notes.php