Opens the control channel to the FTP server. @param[in] strServerHost IP-address or name of the server @param[in] iServerPort Port for channel. Usually this is port 21.
| 382 | /// @param[in] strServerHost IP-address or name of the server |
| 383 | /// @param[in] iServerPort Port for channel. Usually this is port 21. |
| 384 | bool CFTPClient::OpenControlChannel(const tstring& strServerHost, USHORT ushServerPort/*=DEFAULT_FTP_PORT*/) |
| 385 | { |
| 386 | CloseControlChannel(); |
| 387 | |
| 388 | try |
| 389 | { |
| 390 | m_apSckControlConnection->Create(SOCK_STREAM); |
| 391 | CSockAddr adr = m_apSckControlConnection->GetHostByName(CCnv::ConvertToString(strServerHost).c_str(), ushServerPort); |
| 392 | m_apSckControlConnection->Connect(adr); |
| 393 | } |
| 394 | catch(CBlockingSocketException& blockingException) |
| 395 | { |
| 396 | ReportError(blockingException.GetErrorMessage(), CCnv::ConvertToTString(__FILE__), __LINE__); |
| 397 | m_apSckControlConnection->Cleanup(); |
| 398 | return false; |
| 399 | } |
| 400 | |
| 401 | return true; |
| 402 | } |
| 403 | |
| 404 | /// Returns the connection state of the client. |
| 405 | bool CFTPClient::IsConnected() const |
nothing calls this directly
no test coverage detected