Hello,

DownloadFileAsync blocks (or hangs) the application for 3 or 4 seconds if
there is no internet connection available, the expected behavior should be
to continue normally and raise the error in the DownloadFileCompleted event
in AsyncCompletedEventArgs, however this is not the case.

Thanks
Yehia

Re: DownloadFileAsync by Vadym

Vadym
Wed Aug 15 09:58:25 CDT 2007

Hello, Yehia!

Does the url that is passed to DownloadFileAsync contain host name?

If that is so, try using IP address instead hostname, e.g.
http://10.2.2.1/file.text

You wrote on Wed, 15 Aug 2007 02:07:12 +0300:

YA> DownloadFileAsync blocks (or hangs) the application for 3 or 4 seconds
YA> if there is no internet connection available, the expected behavior
YA> should be to continue normally and raise the error in the
YA> DownloadFileCompleted event in AsyncCompletedEventArgs, however this is
YA> not the case.


With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com



Re: DownloadFileAsync by Yehia

Yehia
Wed Aug 15 17:05:38 CDT 2007

yes it does, but how would this matter?


----- Original Message -----
From: "Vadym Stetsiak" <vadmyst@gmail.com>
Newsgroups: microsoft.public.dotnet.framework
Sent: Wednesday, August 15, 2007 5:58 PM
Subject: Re: DownloadFileAsync

> Hello, Yehia!
>
> Does the url that is passed to DownloadFileAsync contain host name?
>
> If that is so, try using IP address instead hostname, e.g.
> http://10.2.2.1/file.text
>
> You wrote on Wed, 15 Aug 2007 02:07:12 +0300:
>
> YA> DownloadFileAsync blocks (or hangs) the application for 3 or 4 seconds
> YA> if there is no internet connection available, the expected behavior
> YA> should be to continue normally and raise the error in the
> YA> DownloadFileCompleted event in AsyncCompletedEventArgs, however this
> is
> YA> not the case.
>
>
> With best regards, Vadym Stetsiak.
> Blog: http://vadmyst.blogspot.com
>

Re: DownloadFileAsync by Vadym

Vadym
Thu Aug 16 03:36:42 CDT 2007

Hello, Yehia!

If there is a host name in the url, API tries to resolve that hostname into
an IP address (DNS) and only then perform connection.
If there is an IP address specified - API tries to connect to it without
resolution.

The lag of 3 or 4 seconds can be due to this resolution process.

You wrote on Thu, 16 Aug 2007 01:05:38 +0300:

YA> yes it does, but how would this matter?


YA> ----- Original Message -----
YA> From: "Vadym Stetsiak" <vadmyst@gmail.com>
YA> Newsgroups: microsoft.public.dotnet.framework
YA> Sent: Wednesday, August 15, 2007 5:58 PM
YA> Subject: Re: DownloadFileAsync

>> Hello, Yehia!

>> Does the url that is passed to DownloadFileAsync contain host name?

>> If that is so, try using IP address instead hostname, e.g.
>> http://10.2.2.1/file.text

>> You wrote on Wed, 15 Aug 2007 02:07:12 +0300:

YA>>> DownloadFileAsync blocks (or hangs) the application for 3 or 4
YA>>> seconds if there is no internet connection available, the expected
YA>>> behavior should be to continue normally and raise the error in the
YA>>> DownloadFileCompleted event in AsyncCompletedEventArgs, however
YA>>> this
>> is
YA>>> not the case.


>> With best regards, Vadym Stetsiak.
>> Blog: http://vadmyst.blogspot.com

With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com



Re: DownloadFileAsync by UL-Tomten

UL-Tomten
Thu Aug 16 03:54:09 CDT 2007


On Aug 16, 10:36 am, "Vadym Stetsiak" <vadm...@gmail.com> wrote:

> If there is a host name in the url, API tries to resolve that hostname [...]

According to MSDN, "This method does not block the calling thread".
Maybe the setup (including DNS resolution, web request creation etc)
should be non-blocking as well, or the documentation changed.