I want to receive a short array from my socket. I know the size of the array sent. Here's what i have so far:
Sending:
bufferSizeForDepth = 640*480*sizeof(short);
short* depth = new short[640*480];
send(sender_socket, depth, bufferSizeForDepth, 0);
Receiving:
bufferSizeForDepth = 640*480*sizeof(short);
short* arr = new short[640*480];
recv(sender_socket, arr, bufferSizeForDepth, 0);
Unfortunately, recv() doesn't receive all of the 614400 Bytes but only about 80000 Bytes. If i repeat that recv() i get an additional 80000 Bytes. I've read it's common that the socket only receives a portion of what it can receive. But now i have a stream of bytes and have no idea how i get a short array. Thanks for your help in advance.