Sends a QUIT command to the FTP server to end the session Arguments: None
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzFtpClient::QuitSession | (void) |
Declared in file: hzFtpClient.h
Defined in file : hzFtpClient.cpp
Function Logic:
Function body:
hzEcode hzFtpClient::QuitSession (void)
{
// Sends a QUIT command to the FTP server to end the session
//
// Arguments: None
//
// Returns: E_SENDFAIL If the command could not be sent
// E_RECVFAIL If the server failed to acknowledge the command
// E_OK If the operation was succussful
_hzfunc("hzFtpClient::QuitSession") ;
uint32_t nRecv ; // Length of server response
uint32_t len ; // Length of client request
hzEcode rc ; // Return code
threadLog("hzFtpClient::QuitSession. Quitting session: - ") ;
sprintf(m_c_sbuf, "QUIT\r\n") ;
len = strlen(m_c_sbuf) ;
rc = m_ConnControl.Send(m_c_sbuf, len) ;
if (rc == E_TIMEOUT)
threadLog("Timed out whilst sending QUIT command\n") ;
else if (rc != E_OK)
threadLog("Could not send QUIT command\n") ;
else
{
rc = m_ConnControl.Recv(m_c_sbuf, nRecv, 1024);
if (rc == E_TIMEOUT)
threadLog("Timed out whilst awaiting QUIT response\n") ;
else if (rc != E_OK)
threadLog("Could not recv QUIT response\n") ;
else
threadLog("FTP Quit Successful\n") ;
}
m_ConnControl.Close() ;
return E_OK ;
}