php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14261 fsockopen w/ udp responds incorrectly
Submitted: 2001-11-27 22:28 UTC Modified: 2002-04-20 05:46 UTC
From: doubledomegenius at aol dot com Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.0.6, 4.1.0RC3 OS: RedHat 7.1
Private report: No CVE-ID: None
 [2001-11-27 22:28 UTC] doubledomegenius at aol dot com
#!/usr/local/bin/php -q
<?
$ipaddress = "udp://192.168.0.1";
$port = 7;
$test = fsockopen($ipaddress,$port,&$errno,&$errstr);
if (!$test) {
echo "DOWN\n";
} else {
echo "UP\n";
}
?>

Responds "UP" when it should timeout and respond "DOWN".

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-28 01:27 UTC] derick@php.net
There were some fixes related to this. Could you possibly try the latest 4.1.0 RC from www.php.net/~zeev/php-4.1.0RC3.tar.gz ?
If it's fixed there, you can use the soon-to-be-released 4.1.0 version.

Derick
 [2001-11-28 14:20 UTC] doubledomegenius at aol dot com
#!/usr/local/bin/php -q
<?
$ipaddress = "udp://192.168.0.1";
$port = 7;
$test = fsockopen($ipaddress,$port,&$errno,&$errstr);
if (!$test) {
echo "DOWN\n";
} else {
echo "UP\n";
}
?>

Responds "UP" when it should timeout and respond "DOWN".
-------------------------

Tried 4.1.0 RC3 on several x86 machines, same problem.
 [2002-03-18 15:20 UTC] wez@php.net
If you var_dump($test), what does it show?
 [2002-04-20 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-04-20 05:46 UTC] wez@php.net
I can reproduce this, but I believe it is expected
behaviour: UDP is a connectionless protocol, so you
don't find out if you have "connected" until you start
reading/writing data to the socket.
I'm marking this as bogus, since that is the way UDP works.

 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 24 22:01:25 2020 UTC