1

So I am running this piece of PHP code

echo file_get_contents("http://soundstreamradio.serverroom.net:7424/currentsong?sid=1");

And it seems to just hang and time out. It works for many other websites, just not this one, and this is the one that I need more than anything!

Thank you

Willy
  • 213
  • 4
  • 10
  • 1
    Is it an audio stream? Then it is an endless file. You can not download the whole file. – ByteHamster Apr 12 '15 at 07:20
  • Sure, might happen, since it depends on the behavior of the addressed server. If that one does not send anything or close the socket, the command will wait... – arkascha Apr 12 '15 at 07:21
  • Check the following articles: http://stackoverflow.com/questions/10236166/does-file-get-contents-have-a-timeout-setting http://stackoverflow.com/questions/22742207/php-setting-a-file-get-contents-timeout – Iffi Apr 12 '15 at 07:22
  • 1
    Not an audio stream, if you follow the link it's literally a page that just outputs some text. If you are saying the socket doesnt close... does this mean that it could have already sent the text, just needs to be manually closed to complete the transfer? – Willy Apr 12 '15 at 07:25
  • Are you behind a firewall/proxy that blocks the 7424 port? – Cristik Apr 12 '15 at 07:39
  • I am not behind a firewall that blocks 7424 @Cristik :( http://soundstreamradio.com/SSR/testing/js/curl.php The above page is where I'm at right now... Dont be confused by the name though, I'm not actually curling it, Im using the above PHP code – Willy Apr 12 '15 at 07:41
  • OK, this second link doesn't work for me either. The one from the question works for me, this is why I asked if there is something your php script and the server that blocks the 7424 port. – Cristik Apr 12 '15 at 09:48

0 Answers0