Return TypeFunction nameArguments
hzEcodehzTcpClient::Send(const void*,unsigned int,)

Declared in file: hzTcpClient.h
Defined in file : hzTcpClient.cpp

Function Logic:

0:START 1:!m_nSock 2:Return E_NOSOCKET 3:nLen==0 4:Return E_OK 5:m_pSSL 6:SSL_write nSent 7:write nSent 8:nSent==0 9:Return E_TIMEOUT 10:nSent!=nLen 11:hzTcpClient::Close 12:Return E_WRITEFAIL 13:Return E_OK

Function body:

hzEcode hzTcpClient::Send (const void* pIn, unsigned int nLen)
{
   _hzfunc("hzTcpClient::Send(void*,uint32_t)") ;
   uint32_t    nSent ;
   if (!m_nSock)   return E_NOSOCKET ;
   if (nLen == 0)  return E_OK ;
   if (m_pSSL)
       nSent = SSL_write(m_pSSL, pIn, nLen) ;
   else
       nSent = write(m_nSock, pIn, nLen) ;
   if (nSent == 0)
   {
       threadLog("Socket timed out while writing to server %s port %d socket %d", *m_Hostname, m_nPort, m_nSock) ;
       return E_TIMEOUT ;
   }
   if (nSent != nLen)
   {
       Close() ;
       threadLog("Socket write error to server %s port %d socket %d", *m_Hostname, m_nPort, m_nSock) ;
       return E_WRITEFAIL ;
   }
   return E_OK ;
}