This sample extension demonstrates keep-alive processing. When an instance of this extension is created, and the HttpExtensionProc entry point function is called by the server, this extension creates a special header that includes the Connection: Keep-Alive element. The Content-Length header element is also set, so that the client browser knows when the server is completed transmission. As part of the response, a form button is sent to the client browser so the user can re-access the extension easily. Note that the extension returns the status code HSE_STATUS_SUCCESS_AND_KEEP_CONN, which requests that the server keep the socket connection open.
This sample is provided for educational purposes only. It has not been tested in a production environment, and Microsoft® will not provide technical support for it.
This project is available in the ...\iissamples\sdk\isapi\extensions\Keep-Alive subdirectory of the Internet services directory.