Original Post
Hi all. Below is the bit of the code for reading from a socket. The commented out part works fine, i.e copying contents of the read socket buffer to the main http message buffer, and appends in on multiple passes. But the line above it, one with memcpy, is to my knowledge supposed to do the same, but it doesn't. The data it copies is all wrong. It gives not just offset, but completely wrong values. filled_to is set to zero for first pass. (WSAGETSELECTEVENT(lParam)) { case FD_READ: ZeroMemory(reading_buf, 256); bytes_read=recv(clientSocket,reading_buf,256,0); memcpy(http_msg+filled_to,reading_buf,bytes_read);// what's wrong here? //for (i=0; i; filled_to+=bytes_read; break; Any ideas? [Edited by - MadMaxz5 on August 7, 2005 8:43:05 AM]