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

Method SendCommand

deps/FtpClient/FTPClient.cpp:1153–1173  ·  view source on GitHub ↗

Sends a command to the server. @param[in] Command Command to send.

Source from the content-addressed store, hash-verified

1151/// Sends a command to the server.
1152/// @param[in] Command Command to send.
1153bool CFTPClient::SendCommand(const CCommand& Command, const CArg& Arguments) const
1154{
1155 if( !IsConnected() )
1156 return false;
1157
1158 try
1159 {
1160 for( TObserverSet::const_iterator it=m_setObserver.begin(); it!=m_setObserver.end(); it++ )
1161 (*it)->OnSendCommand(Command, Arguments);
1162 const std::string strCommand = CCnv::ConvertToString(Command.AsString(Arguments)) + "\r\n";
1163 m_apSckControlConnection->Write(strCommand.c_str(), static_cast<int>(strCommand.length()), mc_uiTimeout);
1164 }
1165 catch(CBlockingSocketException& blockingException)
1166 {
1167 ReportError(blockingException.GetErrorMessage(), CCnv::ConvertToTString(__FILE__), __LINE__);
1168 const_cast<CFTPClient*>(this)->m_apSckControlConnection->Cleanup();
1169 return false;
1170 }
1171
1172 return true;
1173}
1174
1175/// Sends a command to the server.
1176/// @param[in] Command Command to send.

Callers 1

TransferFileMethod · 0.80

Calls 8

AsStringMethod · 0.80
c_strMethod · 0.80
GetErrorMessageMethod · 0.80
CleanupMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
OnSendCommandMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected