| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzTcpClient::Send | (const void*,unsigned int,) |
Declared in file: hzTcpClient.h
Defined in file : hzTcpClient.cpp
Function Logic:
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 ;
}