Executes the FTP command PASV. Set the passive mode. This command requests the server-DTP (data transfer process) on a data to "listen" port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. The response to this command includes the host and port address this server is listening on. @param[out] ulIpAddress IP address the
| 1325 | /// @param[out] ushPort Port the server is listening on. |
| 1326 | /// @return see return values of CFTPClient::SimpleErrorCheck |
| 1327 | int CFTPClient::Passive(ULONG& ulIpAddress, USHORT& ushPort) const |
| 1328 | { |
| 1329 | CReply Reply; |
| 1330 | if( !SendCommand(CCommand::PASV(), CArg(), Reply) ) |
| 1331 | return FTP_ERROR; |
| 1332 | |
| 1333 | if( Reply.Code().IsPositiveCompletionReply() ) |
| 1334 | { |
| 1335 | if( !GetIpAddressFromResponse(Reply.Value(), ulIpAddress, ushPort) ) |
| 1336 | return FTP_ERROR; |
| 1337 | } |
| 1338 | |
| 1339 | return SimpleErrorCheck(Reply); |
| 1340 | } |
| 1341 | |
| 1342 | /// Parses a response string and extracts the ip address and port information. |
| 1343 | /// @param[in] strResponse The response string of a FTP server which holds |
no test coverage detected