Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Internet Connection Application
Message
 
À
06/01/2001 00:16:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00460168
Message ID:
00460300
Vues:
10
The timeout options in WinInet do not work. Never have and I suspect MS will never fix those. If you need shorter timeouts you need to use the call back interfaces or use WinSock.

wwIPStuff includes async calls that let you get around this, but it's faking it with timers. You can find out more at: http://www.west-wind.com/wwipstuff.asp.

+++ Rick ---

>Dear all,
>
>I'm writing a Visual FoxPro program that downloads file from a web site.
>I'm calling the functions in WININET.DLL to do that.
>
>The functions that I called are:
>InternetOpen
>InternetSetOption
>InternetOpenUrl
>InternetReadFile
>InternetCloseHandle
>
>I'd like to set a timeout using a function("InternetSetOption") before i am calling the function "InternetOpenUrl" and "InternetReadFile".
>
>it seems that "InternetReadFile" will wait forever if the connection
>is lost.So i try to fix it as follow :
>In my program, I've written:
>
>#DEFINE INTERNET_OPTION_CONNECT_TIMEOUT 2
>#DEFINE INTERNET_OPTION_RECEIVE_TIMEOUT 6
>#DEFINE INTERNET_OPTION_SEND_TIMEOUT 5
>
>DECLARE INTEGER InternetSetOption IN WININET.DLL ;
> INTEGER,INTEGER,INTEGER @,INTEGER
>
>llRetVal=InternetSetOption(nSession,;
> INTERNET_OPTION_CONNECT_TIMEOUT,;
> @dwTimeoutSecs,4)
>
>llRetVal=InternetSetOption(nSession,;
> INTERNET_OPTION_RECEIVE_TIMEOUT,;
> @dwTimeoutSecs,4)
>
>llRetVal=InternetSetOption(nSession,;
> INTERNET_OPTION_SEND_TIMEOUT,;
> @dwTimeoutSecs,4)
>
>Howerver "InternetSetOption" always return 1 and "InternetReadFile" will wait forever!!!
>
>Any suggestions?
>
>Thanks very much.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform