Edit report at http://bugs.php.net/bug.php?id=53589&edit=1

 ID:                 53589
 Updated by:         [email protected]
 Reported by:        acesjunk at yahoo dot com
 Summary:            Certain Ports do not work properly on fsockopen
-Status:             Open
+Status:             Bogus
 Type:               Feature/Change Request
 Package:            PHP options/info functions
 Operating System:   Windows XP SP3
 PHP Version:        5.3.4
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

Please see the manual page for long2ip


Previous Comments:
------------------------------------------------------------------------
[2010-12-21 15:10:12] acesjunk at yahoo dot com

Description:
------------
---

>From manual page: http://www.php.net/function.fsockopen#See Also

---



When fsocketopen is used to check if a socket is open, it returns true
always on udp, which what I am trying to do is see if a server is up,
this Example will always be true, no matter what, becuase I think it
detects the port if it is open, rather check if it is in use. See Test
Script...

Test script:
---------------
<?php

$ips = long2ip("www.aceintergraphs.com");

$sv1 = @fsockOpen("udp://$ips", (21910), $errno, $errstr, 0.25);

if (!$sv1){

        echo '<br>Server 1';

        echo '<img src="images/soffline.gif" width="100" height="8" alt="Server
1 is Offline">';

}else{

    echo '<br>Server 1';

        echo '<img src="images/sonline.gif" width="100" height="8" alt="Server
1 is Online">';

        fclose($sv1);

}

?>

Expected result:
----------------
I expect for the truth of the port being open or closed. So if server is
down, then it should say server 1 Offline.  But if the Server is up,
then it should say the server is online.  This all is being reported
onto a webpage.  www.aceintergraphs.com! I used this before without the
UDP part for a different server, and different port, which worked
perfectly, but with this port 27910 for a game called Quake2, it does
not work! I was trying to find alternate methods and means to do this,
but with failure.  I searched your site up and down, and was unable to
find a solution without having to do massive php coding.  I would like
to keep things simple, not complicated!  This is going directly to my
webpage, so it can not be too complex, or it will reduce load times for
my site.

Actual result:
--------------
Server always shows as online, or offline when it is really online or
offline!


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53589&edit=1

Reply via email to