Hi,
I have programmed a script for loading the current song and band information from the API every 10 seconds. I am using cURL from PHP.
The problem is after we finish a live transmission, the script is unable to connect to the server, ending with "Time Out" or "Unable to Connect". There is no response from the server, the script hungs and never again receive a response from it.
I have tested moving the script to another server and everything works fine (after the transmission), so, why the script is unable to connect after a live transmission?
Does my script need a cURL special configuration? This is the part of the script where I make the request:
$xml_builder = '<centovacast>
<request class="server" method="getstatus">
<password>mypassword</password>
<username>myusername</username>
</request>
</centovacast>';
$ch = curl_init('
http://myprovider.com/api.php'); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_builder);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_REFERER, '
http://wwww.mywebsite.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ch_result = curl_exec($ch);
curl_close($ch);
I really appreciate the help you can provide. Thank you!