please dont rip this site

Asynchronous I/O Processing

It is important that your ISAPI extensions support asynchronous operations because that frees server pool threads to complete I/O operations. In addition, the IIS server engine already has built-in support to manage asynchronous I/O operations using the completion ports and server thread pool. ISAPI 1.0 only supported synchronous I/O operations through the ReadClient and WriteClient callback functions.

There are two basic types of async processing.You can implement WriteClient as an async process by setting the dwReserved parameter to HSE_IO_ASYNC. ReadClient and TransmitFile use the ServerSupportFunction to indicate asynchronous processing. For TransmitFile this is accomplished by calling the ServerSupportFunction with the dwHSERequest parameter set to HSE_REQ_TRANSMIT_FILE. For ReadClient the dwHSERequest parameter is set to HSE_REQ_ASYNC_READ_CLIENT.

ISAPI 2.0 and later versions support asynchronous write operations using the existing WriteClient callback function with a special flag that indicates the operation has to be performed asynchronously. In addition, these versions of ISAPI provide a mechanism to request the server transmit a file using the Win32 API TransmitFile. Only one asynchronous I/O operation can be in process at a time. If your ISAPI extension begins an asynchronous I/O operation, you should wait until the operation completes before starting another one.

The following steps outline the order of events for asynchronous processing
  1. IIS I/O thread calls the ISAPI extension with an ECB.

  2. Extension returns HSE_STATUS_PENDING and puts the ECB in a worker queue.

  3. Extension starts or re-uses a worker thread for the ECB and adds a ServerSupportFunction to the ECB with the dwHSERequest parameter set to HSE_REQ_IO_COMPLETION. The ECB is put on the worker thread.

  4. The worker thread performs the required work using an async processing function.

  5. When the I/O completes IIS calls the Async IO callback function with the context & IO status (bytes & error code). In the callback the ISAPI DLL may do other calls to either WriteClient or ServerSupportFunction until there are no more bytes waiting to be read or written.

  6. When the worker thread is finished processing, it calls the ServerSupportFunction with the dwHSERequest parameter set to HSE_REQ_DONE_WITH_SESSION. When IIS receives this callback, it destroys the ECB.

Note There is exactly one ECB for each ISAPI request. ECBs may be recycled for subsequent requests (only after the completion of the entire request). After calling the ServerSupportFunction with HSE_REQ_DONE_WITH_SESSION the extension should no longer use the ECB for which the call was made.


© 1997 by Microsoft Corporation. All rights reserved.


file: /Techref/inet/iis/iis/htm/sdk/isap9m93.htm, 4KB, , updated: 2002/5/22 16:43, local time: 2025/9/21 11:35,
TOP NEW HELP FIND: 
216.73.216.125,10-2-80-231:LOG IN

 ©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://www.piclist.com/techref/inet/iis/iis/htm/sdk/isap9m93.htm"> Asynchronous I/O Processing</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2025 contributors:
o List host: MIT, Site host massmind.org, Top posters @none found
- Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .