Sends the existing content in the response buffer to the client.
[IN] true to complete the operation asynchronously; otherwise, false.
[IN] true to send more data in this response; otherwise, false.
[OUT] A pointer to a DWORD that receives the number of bytes sent to the client.
[OUT] A pointer to a Boolean value that receives whether an asynchronous completion is pending for this call.
An HRESULT. Possible values include, but are not limited to, those in the following table.
Indicates that the operation was successful.
Indicates that the data is not valid.
Indicates that there is insufficient memory to perform the operation.
The Flush method sends the currently available response to the client. At a minimum, the response includes the status headers, but it will also include any response buffer that exists when you call the method.
Set the fMoreData parameter to true if more data will be returned after you call the Flush method, or set fMoreData to false if there is no data remaining.
The Flush method supports synchronous and asynchronous operation. Specify the mode of operation by setting the fAsync parameter to true if the operation is asynchronous, or set fAsync to false if the operation is synchronous.
If you are calling this method asynchronously, you must return immediately after the call.
The following code example demonstrates how to use the Flush method to send the current response to the client. Because the Flush method has sent the response headers to the client, the subsequent call to the Clear method will have no effect.