Would be interesting to make some testing. It should be used with overlapped I/O to somewhat preserve the asynchronous nature of ICS. Of course, there won't be any event triggered while transmitting, which could cause trouble to application having a progress bar. Unless TransmitFile is used to send only chunk of files so that an event may be triggered between each chunk.

I even see that there is an lpTransmitBuffer which could be used to send the header portion of a HTTP response which might even enhance HTTP response time.

Really interesting function.

Limitation on two concurrent function on non server operating system could be problematic !

--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be


----- Original Message ----- From: "Angus Robertson - Magenta Systems Ltd" <an...@magsys.co.uk>
To: <twsocket@elists.org>
Sent: Monday, February 07, 2011 8:30 PM
Subject: [twsocket] TransmitFile Windows API


Browsing MSDN, I came across a winsock function that may speed up the ICS
FTP and HTTP servers, which in my testing are slower than others.  It
seems to combine reading a file and sending it over a socket.  Possible
downside is client windows is restricted to two sessions at a time,
server windows no restriction.  Just wondered if anyone had investigated
whether this API is worth the trouble?

MSDN says:

The TransmitFile function transmits file data over a connected socket
handle. This function uses the operating system's cache manager to
retrieve the file data, and provides high-performance file data transfer
over sockets.

BOOL TransmitFile(
   SOCKET hSocket,
   HANDLE hFile,
   DWORD nNumberOfBytesToWrite,
   DWORD nNumberOfBytesPerSend,
   LPOVERLAPPED lpOverlapped,
   LPTRANSMIT_FILE_BUFFERS lpTransmitBuffers,
   DWORD dwFlags
);

The TransmitFile function was primarily added to Winsock for use by
high-performance server applications (web and ftp servers, for example).

http://msdn.microsoft.com/en-us/library/ms740565%28VS.85%29.aspx

Angus

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to