Re: Is my computer connected to the web?
Re: Is my computer connected to the web?
- Subject: Re: Is my computer connected to the web?
- From: Lorenzo <email@hidden>
- Date: Sat, 17 Jan 2004 20:54:16 +0100
Hi,
I use only "stringWithContentsOfURL:" and when I am not connected or that
file doesn't exist, I have to wait so long to get the response. Do you think
there is a Cocoa short way to detect that I am not connected?
I understand the problemes are two, separated.
1) Detect when I am not connected.
2) Detect that the file doesn't exist.
Time ago I used a code that pings a host by its IP, and it works even of FTP
and HTTP protocols (webdav). So, can I use the this code? If yes, how should
I pass the whole pathname of the file and understand quickly that the file
doens't exist? I presume I have to use a thread and tell the user that the
files doens't exist after trying for e.g. 30 second (like Safari uses to
do). Right?
Best Regards
--
Lorenzo
email: email@hidden
>
From: Scott Anguish <email@hidden>
>
Date: Sat, 17 Jan 2004 01:27:03 -0500
>
To: Lorenzo <email@hidden>
>
Cc: email@hidden
>
Subject: Re: Is my computer connected to the web?
>
>
>
On Jan 16, 2004, at 5:58 PM, Lorenzo wrote:
>
>
> Any time I try to get a file from the web
>
> and the line is slow or I am not connected, I have to wait for a
>
> minute just
>
> to know that the file is not available or that the connection doesn't
>
> work
>
> at all.
>
>
>
> How can I know immediately whether my computer is not connected to the
>
> web?
>
>
>
>
>
>
how are you attempting to get the file?
>
>
if you're using the NSURLConnection classes (or NSURLDownload) there
>
are some alternate cache methods you could try that won't try to bring
>
up the net if it's not already up.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.