send len size
That may sound like a beginner question but if the third param is an 'int', it means I cannot put there a number greater than 2,147,483,647.
So a 'long' is out of the question?
int send( __in SOCKET s, __in const char *buf, __in int len, __in int flags );
Yes, a long is out of the question, since long and int are two different types. According to the standard, an int must have a range of at least -32,768 to 32,767, but can be larger. A long is guaranteed to contain at least +/- 2 billion, but could also be larger. On 32 bit systems, an int it is typically implemented as +/- 2 billion anyways (+/- 2^31). On 64-bit systems, an int it's usually larger (+/- 2^63). So on a 64-bit system, you could potentially pass 9 quadrillion (~9x10^18) bytes as a length parameter.
But all of that is a moot point, really. The kernel buffers that actually marshal the data to send on the socket aren't that big, and the sockets themselves just can't handle 2GB worth all at once. Send in reasonably-sized chunks. Something on the order of kilobytes would be good.
Thanks for the thorough explanation.