Possible Duplicate:
Ping with iPhone SDK
I am creating a application. Where before sending request to server i need to long server. How can i do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should check the reachability utility that Apple made:
Reachability on developer.apple.com
I think that will do what you want to do.
EDIT
use it like this:
It will check if you can connect to the internet, and if you can connect to the server with the given adress/ip.