Sockets/Sockets.cpp
bool Socket::recv(size_t bytes, byte* buffer)
{
  size_t bytesRecvd = 0, bytesLeft = bytes;
  byte* pBuf = buffer;
  while (bytesLeft > 0)
  {
    bytesRecvd = ::recv(socket_, pBuf, bytesLeft, 0);
    if (socket_ == INVALID_SOCKET || bytesRecvd == 0)
      return false;
    bytesLeft -= bytesRecvd;
    pBuf += bytesRecvd;
  }
  return true;
}
//----< recv buffer >--------------------------------------------------------
/*
*  - bytes must be less than or equal to the size of buffer
*  - doesn't return until buffer has been filled with requested bytes
*/
< recv buffer >
bytes must be less than or equal to the size of buffer
doesn't return until buffer has been filled with requested bytes
< recv buffer > bytes must be less than or equal to the size of buffer doesn ' t return until buffer has been filled with requested bytes
bool Socket::recv(size_t bytes, byte* buffer)
{
  size_t bytesRecvd = 0, bytesLeft = bytes;
  byte* pBuf = buffer;
  while (bytesLeft > 0)
  {
    bytesRecvd = ::recv(socket_, pBuf, bytesLeft, 0);
    if (socket_ == INVALID_SOCKET || bytesRecvd == 0)
      return false;
    bytesLeft -= bytesRecvd;
    pBuf += bytesRecvd;
  }
  return true;
}
bool Socket :: recv ( size_t bytes , byte * buffer ) { size_t bytesRecvd = 0 , bytesLeft = bytes ; byte * pBuf = buffer ; while ( bytesLeft > 0 ) { bytesRecvd = :: recv ( socket_ , pBuf , bytesLeft , 0 ) ; if ( socket_ == INVALID_SOCKET || bytesRecvd == 0 ) return false ; bytesLeft -= bytesRecvd ; pBuf += bytesRecvd ; } return true ; }
< recv buffer >
 bytes must be less than or equal to the size of buffer
 doesn't return until buffer has been filled with requested bytes
< recv buffer > bytes must be less than or equal to the size of buffer doesn ' t return until buffer has been filled with requested bytes