Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using wininet.DLL Question
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00631860
Message ID:
00631864
Vues:
80
This message has been marked as the solution to the initial question of the thread.
DECLARE INTEGER InternetOpen ;
	   IN WININET.DLL ;
	   STRING, INTEGER, STRING, STRING, INTEGER
nConnection = InternetOpen(...)

DECLARE INTEGER InternetSetOption ;
	   IN WININET.DLL ;
	   INTEGER,  INTEGER, INTEGER @,  INTEGER

* Set all timeouts to 5 sec's
lnTimeOut = 5 * 1000   && milliseconds
llRetVal=InternetSetOption( nConnection,;
	INTERNET_OPTION_CONNECT_TIMEOUT, @lnTimeOut,4)

llRetVal=InternetSetOption(nConnection,;
	INTERNET_OPTION_DATA_RECEIVE_TIMEOUT, @lnTimeOut,4)

llRetVal=InternetSetOption(nConnection,;
	INTERNET_OPTION_DATA_SEND_TIMEOUT, @lnTimeOut,4)

lnTimeOut = 1  &&// Retry only 1 time
llRetVal=InternetSetOption(nConnection,;
	INTERNET_OPTION_CONNECT_RETRIES, @lnTimeOut,4)
>I am using HttpOpenRequest in wininet.dll.
>
>However, when the Server is not responding, it totally locks up my VFP application. I need to do Ctrl_Alt-Del and End Task to get out.
>
>I am using the following code to setup Timeouts, but it is not working!!. I could not find any sample code on this, so I improvised!
>
>lcBuffer = " "
>lnBufsize = 0
>#DEFINE INTERNET_OPTION_CONNECT_TIMEOUT 2
>#DEFINE INTERNET_OPTION_RECEIVE_TIMEOUT 6
>#DEFINE INTERNET_OPTION_SEND_TIMEOUT 5
>= InternetSetOption(0, INTERNET_OPTION_CONNECT_TIMEOUT, @lcBuffer, @lnBufsize)
>= InternetSetOption(0, INTERNET_OPTION_RECEIVE_TIMEOUT, @lcBuffer, @lnBufsize)
>= InternetSetOption(0, INTERNET_OPTION_SEND_TIMEOUT, @lcBuffer, @lnBufsize)
>* -------------------------------------------------
>
>Does anybody know how to correctly set these Timeouts and overcome this problem ?
>
>Cyrus
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform