tfFtpTurnPasv

Jump to: navigation, search

Table of Contents >> Application Reference >> FTP Client API


#include <trsocket.h>


int tfFtpTurnPasv (
ttUserFtpHandle ftpUserHandle,
int onFlag
);


Function Description

This function is used to set the mode of the FTP data connection on the peer FTP server. Note that this API will not send the PASV command to the server. It will merely set the mode on the FTP client session.


  • If the TM_FTP_PASSIVE_MODE_OFF flag is set, then the peer FTP server will initiate the data connection, i.e. connect on the data connection (default setting).
  • If the TM_FTP_PASSIVE_MODE_ON flag is set, then the peer FTP server will not initiate the connection on the data connection, but rather wait for a data connection.
  • The user can turn on/off passive mode by using this function before setting up data connections.


Parameters

  • ftpUserHandle
    The FTP session handle.
  • onFlag
    The FTP passive mode: either TM_FTP_PASSIVE_MODE_ON or TM_FTP_PASSIVE_MODE_OFF.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid FTP session pointer or 'onFlag' was not either TM_FTP_PASSIVE_MODE_ON or TM_FTP_PASSIVE_MODE_OFF.


Table of Contents >> Application Reference >> FTP Client API