View Single Post
Old 04-19-2006, 08:41 AM   #3 (permalink)
kyoryu
Registered User
 
Join Date: Apr 2003
Posts: 34
kyoryu is on a distinguished road
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.
kyoryu is offline   Reply With Quote