Re: [twsocket] TransmitFile Windows API

2011-02-08 Thread Francois PIETTE

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



Again, not really an issue for proper server applications that should be
running on Windows Server, and not XP Pro or something which already have
a limit of five or 10 shares, but not usually sockets.  Anyone developing
servers should already be testing on servers OSs.


Maybe at runtime, TWSocket could check for the OS version and if it is a 
server, use TransmitFile API, if not, use the current method. A property 
could be used to force either mode so that testing is possible or for 
special purposes.


--
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

--
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


Re: [twsocket] TransmitFile Windows API

2011-02-08 Thread Angus Robertson - Magenta Systems Ltd
> Would be interesting to make some testing. It should be used with 
> overlapped I/O to somewhat preserve the asynchronous nature of ICS. 

Never used overlapped I/O, but a simple sync test of TransmitFile should
indicate if the performance increase is worth the effort. 

> Of course, there won't be any event triggered while transmitting, 
> which could cause trouble to application having a progress bar. 

This is mainly intended for servers where progress bars are not needed,
although it would also effect the timeouts in our servers.  

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

Again, not really an issue for proper server applications that should be
running on Windows Server, and not XP Pro or something which already have
a limit of five or 10 shares, but not usually sockets.  Anyone developing
servers should already be testing on servers OSs. 

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


Re: [twsocket] TransmitFile Windows API

2011-02-07 Thread Francois PIETTE
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" 

To: 
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