One, ISAPI overview Microsoft's Web server provides a different ISAPI, and application ISAPI can develop high-performance applications.
ISAPI has two types of components: ISAPI extension and ISAPI filter, this article focuses on the application and development of ISAPI extensions.
An ISAPI application is implemented through a DLL, and the characteristics of the DLL enable it to be loaded as an extension of the Web server itself. Run in the address space of the Web server and only once on the first request, each subsequent request is accomplished by creating a thread (with only a simple function call), which saves a lot of time and space to create a process.
ISAPI extensions typically replace the location of CGI scripts in traditional Web applications, triggered by customers, and serviced for their special requests.
------Listing 1--------------
1.
2.
3.
As shown in Listing 1, the server will invoke the function provided in MyGetGrp.dll to send a GIF image file data to the client browser, where MyGetGrp.dll is an ISAPI extension.
If the server determines that an ISAPI extension will be executed, he first checks to see if the extension is loaded into the cache, and if not, the specified DLL is loaded, and the server calls the HttpExtensionProc () function in the DLL to service the request when the DLL is loaded. This is where the ISAPI programmer places a specific feature operation, and the server passes all the necessary information through a struct type parameter to the function, including the content of the request itself and the callback function that the programmer will use, using the callback function to pass the data to the user and perform other operations.
Note: It is important to keep in mind that the server is starting multithreading to handle multiple requests received at the same time, so the synchronization between threads must be handled correctly, or it can cause data corruption or even system crashes.
Second, develop ISAPI extension application with C + + Builder C + + Builder is another common client/server architecture development tool developed by Inprise Company following Delphi. It uses the C + + language to produce faster and more efficient code. It has become one of the most attractive development tools in the 32-bit Windows environment following Visual Basic and Delphi.