Click or drag to resize

CFtp.InternetStatus Method

X#
Method InternetStatus() is a callback placeholder to receive current status information for an FTP session. It should be overloaded by subclasses to implement the desired behavior.

Namespace:  VO
Assembly:  VOInternetClasses (in VOInternetClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD InternetStatus(
	nContext,
	nStatus,
	pStatusInfo,
	nStatusLength
) AS USUAL CLIPPER
Request Example View Source

Parameters

nContext (Optional)
Type: Usual
Application-defined context value associated with the current class.
nStatus (Optional)
Type: Usual
Status code that indicates the reason for calling. It can be one of the following values:
pStatusInfo (Optional)
Type: Usual
Address of a buffer that contains information pertinent to this call to the callback function.
nStatusLength (Optional)
Type: Usual
Size of the pStatusInfo buffer.

Return Value

Type: Usual
Remarks
The InternetStatus() method can be used to receive different status information at any stage of an FTP transfer between the FTP client and server.
Examples
The following example demonstrates using the InternetStatus() method to notify every status change to the owner window:
X#
 1CLASS MyFTP INHERIT CFtp
 2  PROTECT oOwner   AS OBJECT
 3METHOD Init(oParent, cCaption, n, lStat)CLASS MyFtp
 4  SUPER:Init(cCaption, n, lStat)
 5  SELF:oOwner := oParent
 6  RETURN SELF
 7METHOD InternetStatus( nContext, nStatus, ; pStatusInfo, nStatusLength ) CLASS MyFTP
 8// 
 9// This method receives all Low Level FTP
10// notification. Please keep all parameters if you
11// want to overwrite it for your own purpose
12// 
13LOCAL cMsg AS STRING
14DO CASE
15CASE nStatus == INTERNET_STATUS_RESOLVING_NAME
16  cMsg := "Resolving Name ... "
17CASE nStatus == INTERNET_STATUS_NAME_RESOLVED
18  cMsg := "Name resolved"
19CASE nStatus == INTERNET_STATUS_CONNECTING_TO_SERVER
20  cMsg := "Connecting to Server ... "
21CASE nStatus == INTERNET_STATUS_CONNECTED_TO_SERVER
22  cMsg := "Connected to Server"
23CASE nStatus == INTERNET_STATUS_SENDING_REQUEST
24  cMsg := "Sending Request ... "
25CASE nStatus == INTERNET_STATUS_REQUEST_SENT
26  cMsg := "Request sent"
27CASE nStatus == INTERNET_STATUS_RECEIVING_RESPONSE
28  cMsg := "Receiving response ..."
29CASE nStatus == INTERNET_STATUS_RESPONSE_RECEIVED
30  cMsg := "Response received"
31CASE nStatus == INTERNET_STATUS_CTL_RESPONSE_RECEIVED
32  cMsg := "CTL Response received"
33CASE nStatus == INTERNET_STATUS_PREFETCH
34  cMsg := "Prefetch"
35CASE nStatus == INTERNET_STATUS_CLOSING_CONNECTION
36  cMsg := "Closing Connection ..."
37CASE nStatus == INTERNET_STATUS_CONNECTION_CLOSED
38  cMsg := "Connection closed"
39CASE nStatus == INTERNET_STATUS_HANDLE_CREATED
40  cMsg := "Handle created"
41  //      _DebOut32( "FTP Status : " + cMsg )
42  RETURN
43CASE nStatus == INTERNET_STATUS_HANDLE_CLOSING
44  cMsg := "Closing handle ..."
45CASE nStatus == INTERNET_STATUS_REQUEST_COMPLETE
46  cMsg := "Request complete"
47CASE nStatus == INTERNET_STATUS_REDIRECT
48  cMsg := "Redirect"
49OTHERWISE
50  cMsg := "Unkown FTP Status"
51ENDCASE
52SELF:oOwner:FTPStatus := cMsg
53RETURN NIL
See Also