The ReadClient function reads data from the body of the client's HTTP request.
The ReadClient function reads information from the body of the Web client's HTTP request into the buffer supplied by the caller. Thus, the call can be used to read data from an HTML form that uses the POST method.
It is not necessary to call ReadClient unless the EXTENSION_CONTROL_BLOCK Structure member cbTotalBytes is larger than cbAvailable (also in EXTENSION_CONTROL_BLOCK). If the buffer size that your extension has allocated, specified by lpdwSize, is less than the number of bytes available, as specified by the EXTENSION_CONTROL_BLOCK member cbAvailable, then your ReadClient call will return immediately with the requested amount of data. Your extension will need to call ReadClient multiple times to retrieve all the data. If the buffer size is greater than the number of bytes available, ReadClient will fill the available space.
ReadClient will time out after 60 seconds, regardless of any IIS server time-out settings. If you expect that the client of your ISAPI extension will regularly take more than 60 seconds to respond to a read, then you should perform asynchronous reads through the HSE_REQ_ASYNC_READ_CLIENT function of ServerSupportFunction Function, instead of synchronous ReadClient calls. Asynchronous read requests make better use of the IIS I/O thread pool, and can have time-out values regulated using the connection time-out value, accessible in the MMC.
Alternatively, if you are unable to use asynchronous reads, you can loop by initiating another synchronous ReadClient call after the 60-second timeout period has elapsed.
If the socket on which the server is listening to the client is closed, ReadClient will return TRUE, but with zero bytes read.