| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzTcpClient::Recv | (void*,unsigned int&,unsigned int,) |
Declared in file: hzTcpClient.h
Defined in file : hzTcpClient.cpp
Function Logic:
Function body:
hzEcode hzTcpClient::Recv (void* vpOut, unsigned int& nRecv, unsigned int nMax)
{
_hzfunc("hzTcpClient::Recv(1)") ;
char* cpOut ;
int32_t nBytes ;
cpOut = (char*) vpOut ;
cpOut[0]= 0;
nRecv = 0;
if (!m_nSock)
return E_NOSOCKET ;
if (nMax == 0)
return E_OK ;
if (m_pSSL)
nBytes = SSL_read(m_pSSL, cpOut, nMax) ;
else
nBytes = recv(m_nSock, cpOut, nMax, 0);
if (nBytes < 0)
{
if (errno == EAGAIN) return E_OK ;
if (errno == ETIMEDOUT) return E_TIMEOUT ;
return E_RECVFAIL ;
}
nRecv = nBytes ;
return E_OK ;
}