Re: transmitFile() function
"CppSavvy" <CppSavvy@discussions.microsoft.com> wrote in message
news:B8BDF443-F424-48C3-86A4-5EEC58CA674E@microsoft.com...
How can transmit memory-mapped files using transmitFiles() function?.
If you have mapped a file, you should have a file handle. And if your server
and client applications have connected, you should have a socket. If that's
so, it should be as simple matter to call the function to transfer the data
as to call send() to transmit a plain old block of data.
An issue for the sender and receiver is to agree on the headers trailers
which bracket the transmission. That ought to be a nit, though.
So what have you tried and what are you having trouble with?
Just by the way, the reason why TransmitFile() was added to the Win32 API
was to avoid unnecessary buffering by applications and to push that
responsibility to operating system:
http://blogs.msdn.com/larryosterman/archive/2004/08/03/207390.aspx
So, if your file is already mapped, go for it. But if it is not, I'd forego
the mapping and let Win32 do the heavy lifting. YMMV.
Regards,
Will