Hi,
I would like to turn this function:
into something like:Code:std::string Socket::ReceiveBytes() { std::string ret; char buf[1024]; while (1) { u_long arg = 0; if (ioctlsocket(s_, FIONREAD, &arg) != 0) break; if (arg == 0) break; if (arg > 1024) arg = 1024; int rv = recv (s_, buf, arg, 0); if (rv <= 0) break; std::string t; t.assign (buf, rv); ret += t; } return ret; }
bool Socket::ReceiveBytes(char * buffer, const int buffersize);
how should I change it internally?
thanks




Reply With Quote