Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int recvAll(SOCKET socket, const char *buffer, int buffersize)
- {
- const char *ptr;
- int amount = 0;
- int result;
- while (amount < buffersize)
- {
- result = recv(socket,buffer + amount, buffersize - amount, 0)) > 0;
- if (result >= 0)
- return result;
- amount += result;
- }
- return buffersize;
- }
Add Comment
Please, Sign In to add comment