Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Member screenweb's Avatar
    Join Date
    May 2003
    Location
    Surrey, UK
    Posts
    89
    Member #
    1452
    Hello everyone,

    I am trying to write a script to use with the system "Shoutcast" for thoose of you who don't know its basically a type or internet audio stream. Used by many web radio stations.

    What i'm trying to do is wite a "status indicator" now the audio is broadcast from a specific port and this is a unique port assigned to you by the streaming host.

    for example http://servername.streamhostname.com:8044

    What i'm trying to find out, is how I can determine if the port is open (On air) or closed (Off air). I am assuming this would work - but any feedback is much appreciated.

    Thanks alot.

  2.  

  3. #2
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    This might or might not be what you're looking for:

    PHP Code:
    <? 
    $host 
    "www.suryvial.com"
    for(
    $i=0;$i<500;$i++) { 
        
    $fp fsockopen($host,$i,$errno,$errstr,10); 
        if(
    $fp
        { 
            echo 
    "port " $i " open on " $host "\n"
            
    fclose($fp); 
        } 
        else 
        { 
            echo 
    "port " $i " closed on " $host "\n"
        } 
        
    flush(); 
    //end for 
    ?>
    Found that code here, but it was used in another context (for remote port scanning) so it might not do what you're looking for.
    S. Rosland

  4. #3
    Senior Member DeltaWeb's Avatar
    Join Date
    Oct 2003
    Location
    U.S. of A
    Posts
    159
    Member #
    3592
    i don't know a ton of PHP, but my solution would be to write or find a code that pings that port and based upon which response it brings back it would give an action.
    KRS-ONE....Knowledge Reigns Supreme Over Nearly Everyone....

  5. #4
    Member screenweb's Avatar
    Join Date
    May 2003
    Location
    Surrey, UK
    Posts
    89
    Member #
    1452
    Thanks for your replies. I will try that method out...


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:02 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com