Unless I'm mistaken (and I may well be), it appears that you're overwriting your data with each receive call. You either need to memcpy the data received into the final output buffer, or use an offset
Code:
int result;
result = recv(clntSocket, buffer+bytes_read_so_far, RECV_SIZE - bytes_read_so_far, 0);
bytes_read_so_far += result;
to put the new data at the end of the data received.
Note: the example code doesn't check the returned result.