Reputation: 3361
How do you ping an IP address from your iOS app code? Is it same as trying to connect to it via NSURLConnection?
Upvotes: 3
Views: 7507
Reputation: 2061
and thus I'd be able to use NSURLConnection
for both?
The simple answer (as far as your programming choices):
no
ping uses ICMP, web connections use TCP.
These protocols are peers, they are not the same.
NSURLConnection makes TCP connections for HTTP and HTTPS. As best I can tell, it cannot use any peer protocol families that live on top of network addressing (v4 and v6), which is the "internet protocol or IP" of TCP/IP.
Upvotes: 0
Reputation: 910
Here is a link to apple's sample code: http://developer.apple.com/library/mac/#samplecode/SimplePing/Introduction/Intro.html
It is the same code iOS and OS X
Upvotes: 3