From:             
Operating system: Windows XP SP3
PHP version:      5.3.4
Package:          PHP options/info functions
Bug Type:         Feature/Change Request
Bug description:Certain Ports do not work properly on fsockopen

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 bug report at http://bugs.php.net/bug.php?id=53589&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53589&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53589&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53589&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53589&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53589&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53589&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53589&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53589&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53589&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53589&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53589&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53589&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53589&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53589&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53589&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53589&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53589&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53589&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53589&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53589&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53589&r=mysqlcfg

Reply via email to