MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / OpenControlChannel

Method OpenControlChannel

deps/FtpClient/FTPClient.cpp:384–402  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

382/// @param[in] strServerHost IP-address or name of the server
383/// @param[in] iServerPort Port for channel. Usually this is port 21.
384bool 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.
405bool CFTPClient::IsConnected() const

Callers

nothing calls this directly

Calls 6

CreateMethod · 0.80
GetHostByNameMethod · 0.80
c_strMethod · 0.80
ConnectMethod · 0.80
GetErrorMessageMethod · 0.80
CleanupMethod · 0.80

Tested by

no test coverage detected