This is interesting; it says that this api is better because it only has one kernel call.

"
TransmitFile and TransmitPackets
Winsock offers two functions for transmitting data that are optimized for file and memory transfers. The TransmitFile
API is present on both Windows NT 4.0 and Windows 2000, while TransmitPackets is a new Microsoft extension
function that is expected to be available in a future release of Windows. TransmitFile allows the contents of a file to be
transferred on a socket. Normally, if an application were to send the contents of a file over a socket, it would have to call
CreateFile to open the file and then loop on ReadFile and WSASend until the entire file was read. This is very inefficient
because each ReadFile and WSASend call requires a transition from user mode to kernel-mode. TransmitFile simply
requires an open handle to the file to transmit and the number of bytes to transfer. The overhead is incurred when opening
the file via CreateFile, followed by a single kernel-mode transition. If your app sends the contents of files over sockets,
this is the API to use.
"

http://msdn.microsoft.com/msdnmag/issues/1000/winsock/winsock.asp?frame=true
Posted on 2002-04-20 18:17:28 by bdjames
How nice of them:

Remarks
The Windows NT Server/Windows 2000 Server optimizes the TransmitFile function for high performance. The Windows NT Workstation/Windows 2000 Professional optimizes the function for minimum memory and resource utilization. Expect better performance results when using TransmitFile on Windows NT Server/Windows 2000 Server.
Posted on 2002-04-20 20:19:26 by bdjames
Well, would you expect them to not handicap their workstation
versions of the OS? :). Also, I probably wouldn't use TransmitFile
generically... you lose a bit control (even though the function looks
pretty flexible). It looks like it could be good for a webserver (lots
of small files to send, possibly a lot of clients hammering you).
Posted on 2002-04-21 11:19:42 by f0dder