Sockets/Sockets.cpp
bool Socket::sendString(const std::string& str, byte terminator)
{
	size_t bytesSent;
	size_t bytesRemaining = str.size();
  const byte* pBuf = &(*str.begin());
  while (bytesRemaining > 0)
  {
    bytesSent = ::send(socket_, pBuf, bytesRemaining, 0);
    if (bytesSent == INVALID_SOCKET || bytesSent == 0)
      return false;
    bytesRemaining -= bytesSent;
    pBuf += bytesSent;
  }
  ::send(socket_, &terminator, 1, 0);
  return true;
}
//----< sends a terminator terminated string >-------------------------------
/*
 *  Doesn't return until entire string has been sent
 *  By default terminator is '\0'
 */
< sends a terminator terminated string >
Doesn't return until entire string has been sent
By default terminator is '\0'
< sends a terminator terminated string > Doesn ' t return until entire string has been sent By default terminator is ' \ 0 '
bool Socket::sendString(const std::string& str, byte terminator)
{
	size_t bytesSent;
	size_t bytesRemaining = str.size();
  const byte* pBuf = &(*str.begin());
  while (bytesRemaining > 0)
  {
    bytesSent = ::send(socket_, pBuf, bytesRemaining, 0);
    if (bytesSent == INVALID_SOCKET || bytesSent == 0)
      return false;
    bytesRemaining -= bytesSent;
    pBuf += bytesSent;
  }
  ::send(socket_, &terminator, 1, 0);
  return true;
}
bool Socket :: sendString ( const std :: string & str , byte terminator ) { size_t bytesSent ; size_t bytesRemaining = str . size ( ) ; const byte * pBuf = & ( * str . begin ( ) ) ; while ( bytesRemaining > 0 ) { bytesSent = :: send ( socket_ , pBuf , bytesRemaining , 0 ) ; if ( bytesSent == INVALID_SOCKET || bytesSent == 0 ) return false ; bytesRemaining -= bytesSent ; pBuf += bytesSent ; } :: send ( socket_ , & terminator , 1 , 0 ) ; return true ; }
< sends a terminator terminated string >
  Doesn't return until entire string has been sent
  By default terminator is '\0'
< sends a terminator terminated string > Doesn ' t return until entire string has been sent By default terminator is ' \ 0 '