iPhone Server Mirror Functionality
        Posted  
        
            by hecta
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by hecta
        
        
        
        Published on 2010-06-16T15:20:03Z
        Indexed on 
            2010/06/16
            15:22 UTC
        
        
        Read the original article
        Hit count: 212
        
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)
© Stack Overflow or respective owner