WinInetSetOptions Method
Class: FTP_SERVICE
Description:Set Timeout for connection
Set timeouts for connection.
=
Object.WinInetSetOptions
([@laFlags])
Parameter
laFlags
The flags that indicate various options.
Type Numeric/Array
By reference  
Direction Input
Optional  
This can be a combination of these values:
INTERNET_OPTION_CONNECT_TIMEOUTSets or retrieves an unsigned long integer value that contains the time-out value, in milliseconds, to use for Internet connection requests.
INTERNET_OPTION_RECEIVE_TIMEOUTSets or retrieves an unsigned long integer value that contains the time-out value, in milliseconds, to receive a response to a request.
INTERNET_OPTION_SEND_TIMEOUTSets or retrieves an unsigned long integer value that contains the time-out value to send a request. Units are in milliseconds.
INTERNET_OPTION_CONNECT_RETRIESSets or retrieves an unsigned long integer value that contains the number of times Microsoft Win32® Internet (WinInet) will attempt to resolve and connect to a host.

Assumed from MSDN.

Return value Boolean
.T.The functions return always .T..
Example

Set before connect to internet

LOCAL loFTP SET PROCEDURE TO ftp.prg ADDITIVE loFTP=CREATEOBJECT('ftp_service') loFTP.aIOptions(INTERNET_OPTION_CONNECT_TIMEOUT)=7200*1000 loFTP.aIOptions(INTERNET_OPTION_RECEIVE_TIMEOUT)=7200*1000 loFTP.aIOptions(INTERNET_OPTION_SEND_TIMEOUT)=7200*1000 loFTP.aIOptions(INTERNET_OPTION_CONNECT_RETRIES)=10 IF loFTP.OpenInternet("ABONNE", "PWD", "10.10.10.10", "21") IF loFTP.GetFTPFile("any.txt","local.txt") ?STRTRAN("File %File% downloaded","%File%","local.txt") ELSE ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg() ENDIF =loFTP.CloseInternet() ENDIF RELEASE PROCEDURE ftp.prg

Set after connect to internet

LOCAL loFTP LOCAL ARRAY laSet(INTERNET_OPTION_MAXFLAG) SET PROCEDURE TO ftp.prg ADDITIVE loFTP=CREATEOBJECT('ftp_service') IF loFTP.OpenInternet("ABONNE", "PWD", "10.10.10.10", "21") laSet(INTERNET_OPTION_CONNECT_TIMEOUT)=7200*1000 laSet(INTERNET_OPTION_RECEIVE_TIMEOUT)=7200*1000 laSet(INTERNET_OPTION_SEND_TIMEOUT)=7200*1000 laSet(INTERNET_OPTION_CONNECT_RETRIES)=10 loFTP.WinInetSetOptions(@laSet) IF loFTP.GetFTPFile("any.txt","local.txt") ?STRTRAN("File %File% downloaded","%File%","local.txt") ELSE ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg() ENDIF =loFTP.CloseInternet() ENDIF RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure WinInetSetOptions Source Code
      LPARAMETERS laFlags
      EXTERNAL ARRAY laFlags
      LOCAL llRetVal,lii,luVal
      LOCAL ARRAY m.laFlagsX(INTERNET_OPTION_MAXFLAG)
      IF TYPE("m.laFlags")="N"
         =ACOPY(m.laFlags,m.laFlagsX)
      ELSE
         =ACOPY(This.aIOptions,m.laFlagsX)
      ENDIF

      FOR lii= 1 TO ALEN(m.laFlagsX)
          luVal= m.laFlagsX(m.lii)
          IF TYPE("m.luVal")="N"
             llRetVal=InternetSetOption(This.nInet_Handle,m.lii,@m.luVal,4)
          ENDIF 
      NEXT
      RETURN .T.