ping to web server from iphone
<p>I am developing an aplication which needs to download some data from webserver.So i need to first ping to the web server to check whether the service is available after checking the internet connectivity .I used the following code to check server availability</p>

<pre><code>`   BOOL success = NO;
    const char *host_name = [@"http://192.168.1.7:8080/TestWeb/webresources/"
                             cStringUsingEncoding:NSASCIIStringEncoding];

    SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL,
                                                                                host_name);
    SCNetworkReachabilityFlags flags;
    success = SCNetworkReachabilityGetFlags(reachability, &amp;flags);
    BOOL isAvailable = success &amp;&amp; (flags &amp; kSCNetworkFlagsReachable) &amp;&amp; !(flags &amp; kSCNetworkFlagsConnectionRequired);
    return isAvailable;
</code></pre>

<p>`</p>

<p>where my server is uploaded locally.But this code always return an invalid result,but it works correctly if i gave some exixting sites like google.com.Please let me know whats i am doing wrong..</p>
