SmartFTP FTP Library
_IFTPConnectionEvents Interface
sfFTPLib::_IFTPConnectionEvents
IDL
dispinterface _IFTPConnectionEvents;

Event dispatch interface for the IFTPConnection interface. 

 

Technical Details 

All events are synchronous. Depending on the class providing the _IFTPConnectionEvents interface, events are fired from different threads. The FTPConnectionSTA fires all events from the main thread, the FTPConnectionMTA class fires the events from the worker thread. 

 

C++  

#import "libid:7A3A786C-EB8C-43b3-BC10-8D09ACF5D195"
// Note: Uncomment for Microsoft Visual Studio 6.0
//#import "C:\Program Files\SmartFTP FTP Library\sfFTPLib.dll"

CComPtr<IFTPConnection> pConnection;
if(SUCCEEDED(pConnection.CoCreateInstance(__uuidof(sfFTPLib::FTPConnection))))
{
    // How to Advise
    DWORD dwCookie = 0xEFEFEFEF;
    AtlAdvise(pConnection, m_pEventSink, __uuidof(sfFTPLib::_IFTPConnectionEvents), &dwCookie);

    // How to Unadvise
    if(m_dwCookie != 0xFEFEFEFE)
    {
        AtlUnadvise(pConnection, __uuidof(sfFTPLib::_IFTPConnectionEvents), dwCookie);
    }
}

 

VB6

Dim WithEvents objFTP As FTPConnectionSTA
Set objFTP = New FTPConnectionSTA

Private Sub objFTP_OnTransferProgress(ByVal nBytesTransferredLo As Long, ByVal nBytesTransferredHi As Long)
'Label1.Caption = nBytesTransferredLo
End Sub
_IFTPConnectionEvents Methods 
Description 
The event is fired after the Disconnect method completed.
See OnSocketDisconnect as well. 
The event is fired after the login succeeded. 
The event is fired when the socket is connected to the host. The event is triggered when the winsock notify FD_CONNECT is received. 
The event is fired when the socket is disconnected/closed. The event is triggered when the winsock notify FD_CLOSE is received.
See also OnDisconnect 
The event is fired when the client sends a command, receives a server response or for internal messages.

If the type t equals ftpStatusEventTypeLocalHelp the strText contains the following values:  
The event is fired on a timeout. A timeout can happen during a data transfer or when sending commands.
To set the timeout use the Timeout property in the IFTPConnection interface. 
The event is fired after a transfer (list, upload, download, fxp) completed. 
The event is fired during data transfers.
Data transfers include directory listings, uploads and downloads. The event is fired every 500 ms. 
The event is fired after a transfer (list, upload, download, fxp) started. 
Called during the SSL/TLS handshake. Client can verify the server certificate and set the bContinue value accordingly. 
What do you think about this topic? Send feedback!
Copyright (c) by SmartSoft Ltd. All rights reserved.