Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 24th November 2014, 18:58   #1
ProducerMike
Junior Member
 
Join Date: Nov 2014
Posts: 2
Shoutcast 2.0 stats file read by python pauses for 5 sec each read

I'm writing some simple python code to read the stats.xml file from a Shoutcast 2.0 server which I have on a test network. Each time the python script attempts to read the file it pauses for 5 seconds.

Python 2.6.5 on Ubuntu or Python 2.7.3 on Raspberry Pi Shoutcast 2.0.0.29 on Windows 7 - 64Bit

Using Urllib2

code:
import urllib2
statsfile = urllib2.urlopen('http://10.46.0.43:8000/stats?sid=1')



This will read the file but causes a 5 second pause in program execution. Almost like a timeout. I have tried this on both a raspberry pi and also a Ubuntu box. The same happens if I run it as a python program or entering commands in the python cli.

The stats.xml is correctly read and transferred it's just the pause that's causing the problem.

I have also copied the stats.xml file to an IIS server and the python script runs fine reading the file from there.

I have also tried urllib.urlretrieve which produces the same result.

This is on a small test network so I don't believe it is bandwidth. I am using a IP address to rule out DNS issues. It is 100% reproducible. I have rebuilt the Windows 7/Shoutcast server and am still getting the issue.

Any good ideas, anyone?

Thanks in advance

ProducerMike
ProducerMike is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Shoutcast > Shoutcast Technical Support

Tags
python, shoutcast, stats, urllib2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump