Executes the FTP command PORT (DATA PORT) The argument is a HOST-PORT specification for the data port to be used in data connection. There are defaults for both the user and server data ports, and under normal circumstances this command and its reply are not needed. If this command is used, the argument is the concatenation of a 32-bit internet host address and a 16-bit TCP port address. @param[i
| 1508 | /// @param[in] uiPort 16-bit TCP port address. |
| 1509 | /// @return see return values of CFTPClient::SimpleErrorCheck |
| 1510 | int CFTPClient::DataPort(const tstring& strHostIP, USHORT ushPort) const |
| 1511 | { |
| 1512 | tstring strPortArguments; |
| 1513 | // convert the port number to 2 bytes + add to the local IP |
| 1514 | strPortArguments = CMakeString() << strHostIP << _T(",") << (ushPort>>8) << _T(",") << (ushPort&0xFF); |
| 1515 | |
| 1516 | ReplaceStr(strPortArguments, _T("."), _T(",")); |
| 1517 | |
| 1518 | CReply Reply; |
| 1519 | if( !SendCommand(CCommand::PORT(), strPortArguments, Reply) ) |
| 1520 | return FTP_ERROR; |
| 1521 | return SimpleErrorCheck(Reply); |
| 1522 | } |
| 1523 | |
| 1524 | /// Executes the FTP command TYPE (REPRESENTATION TYPE) |
| 1525 | /// Caches the representation state if successful. |
no test coverage detected