ftp_get_last_handshake_duration

FTP Functions (ftp)

Returns the duration of the most recent connection creation.

double ftp_get_last_handshake_duration( );

ftp_get_last_handshake_duration returns the duration of the last connection creation in milliseconds.

  Example

This example shows the use of the download information functions.

Copy code
double duration;
double duration; 
    unsigned long lSize, lDur; 
    int i; 
    char * host = "ftp.microsoft.com"; 
    // For user "charlotte" defined on "myHost"://"host"\\"user" 
    char * user = "ftp://anonymous:email%40notset.com@ftp.microsoft.com/bussys/readme.txt"; // Note double backslash 
    char * pwd = "anonymous"; 
    char * port = "21"; 
    char ftpURL[100]; 
    sprintf(ftpURL, "URL=ftp://%s:%s@%s:%s", user, pwd, host, port); 
    lr_output_message ("%s", ftpURL); 
    // Logon to node "host"
    ftp_logon ("Transaction1", ftpURL, 
            LAST ); 
    // c:\inetput\ftproot\testFiles        
    ftp_dir ("T1", "PATH=/testFiles", 
            LAST ); 
    ftp_get ("Get_Small_File", "bussys/readme.txt",
            LAST ); 
    duration= ftp_get_last_transfer_duration(); 
    lr_output_message ("Get_Small_File Transfer took %.3f milliseconds", duration); 
    ftp_get_last_download_details (&lSize, &lDur); 
    lr_output_message ("Get_Small_File Download of %d bytes took %d milliseconds", lSize, lDur); 
    ftp_get ("Get_Large_File", "SOURCE_PATH=bussys/readme.txt",
            LAST ); 
    duration= ftp_get_last_transfer_duration(); 
    lr_output_message ("Get_Large_File Transfer took %.3f milliseconds", duration); 
    ftp_get_last_download_details (&lSize, &lDur); 
    lr_output_message ("Transfer of %d bytes took %d milliseconds", lSize, lDur); 
    duration = ftp_get_last_handshake_duration(); 
    lr_output_message ("Handshake took %f milliseconds", duration); 
    ftp_logout();