views:

17

answers:

0

My app reads a from decentralized (so I have the ability to change servers if I have to) xml file with TBXML parser. The xml file consists of only a few lines like this

<xml>
<mirror url="http://www.someserverabc.com/data.xml" priority="1"/>
<mirror url="http://www.someservermirror.com/data.xml" priority="2"/>
<mirror url="http://www.anotherserver.com/data.xml/" priority="3"/>
</xml>

So I have the corresponding priority to the url. Now I want to check if server with priority 1 is reachable, and if not, try the 2nd one and so forth. If a server is reachable I'm parsing XML with the url from the mirror list

How could I implement this approach and is it even a good approach or how can this be tweaked? (is XML even desirable in the first scenario)