send() returns the number of bytes transferred to the socket send buffer. If it returns 50,000, then 50,000 bytes were transferred. If you didn't receive them all, the problem is at the receiver, or in the network.
You would have to post some code before any further analysis is possible.
Probably you're expecting to receive all those bytes in a single recv() call. It isn't obliged to do that by its specification. You have to loop:
char buffer[8192];
int length = ... // number of bytes expected;
int total = 0;
int count;
while (total < length && (count = recv(socket, buffer, min(sizeof buffer, length-total), 0)) > 0)
{
write(outfd, buffer, count); // or do something else with buffer[0..count-1]
total += count;
}
if (count < 0)
{
perror("recv");
}
Or else you've done an abortive close at the sender which discards data in flight.
Or you got an error during recv() and didn't detect it in your code.
Or ...