From IIS to Page Object (1)

Source: Internet
Author: User
I have carefully read the first section in chapter 3 of <asp. NET Component Design> of Mr. Huang zhongcheng over the past few days. Title: from IIS to page object
I know more about the content of this chapter. Although the content of this chapter is obscure, it is indeed the essence, so I have read it several times, in addition, I also found some relevant information on the Internet to learn about it.
I want to share my experiences with you and learn from them.

First, when the visitor enters the URL in the browser and the request is passed to the IIS server, we assume that the request is a *. aspx file, and the request will be
Inetinfo.exe process intercepted,
All requests must pass inetinfo.exe to determine the request file extension. When it learns that it is. aspx, it will forward the request to the aspnet_isapi.dll file.
(You can obtain more information through the request file extension ing table in IIS ),
Aspnet_isapi.dll also plays an entry role here. After obtaining this request, it will forward the request
Aspnet_wp.exe process,
Aspnet_wp.exe will solve the information in the request, that is, the virtual directory information, to create a new appdomain.
Aspnet_wp.exe checks whether the appdomain corresponding to the virtual directory exists. If it exists, it does not need to be created. If it does not exist, a new appdomain object is created and then added.
Assemblys and other files required by visitors during Asp.net execution. Therefore, the number of AppDomains in IIS and the number of Asp.net virtual directories accessed
The number is the same.
Then, aspnet_wp.exe will send the request to the isapiruntime object in the appdomain,
The isapiruntime object is resolved by the ISAPI package and then forwarded to the httpruntime object.
The httpruntime. processrequest function processes user requests.
Httpruntime. processrequest creates an httpcontext object and manages httpcontext and cache.
Who created it, which may be allocated by IIS). After httpcontext is created,
Httpruntime then sends the request to the httpapplicationfactory container, and the httpapplicationfactory creates
Httpapplication object. httpapplicationfactory first interprets
The global. asax file, load the application assembly (Global. dll) in the virtual directory, and then combine the two to create the ghost
Application
Class, and finally compile some classes to get the object and return it to the httpruntime object. The obtained object is the httpapplication object.
Httpruntime gives requests to the httpapplication object for processing. Here I have a question, I do not know the application
Is assembly (Global. dll) All DLL files under bin in a virtual directory? Please answer your questions!
After httpapplication is created,
The httpruntim object calls the httpapplication. processrequest function to process the request. Here Mr. Huang zhongcheng is talking about
The httpapplication. processrequest function transfers the request to the corresponding httphandler object for processing.
During the initialization of the httpapplication, the relevant httpmodules module is loaded, but the real function of httpmodules is not much, but it is just clicked.
It is indeed a pity. Later I found that httpapplication. processreques does not directly forward the request to httpappliction
In the httpmodules module, httpmodeules is the only way to request.
Yes, one of the events is httpmodule. prerequesthandlerexecute (). After the event is processed, it enters httphandler,
Then httphandler can process the request, return the result to httpmodules after processing, and then run
Httpmodule. postrequesthandlerexecute (), and other module events until the entire request ends.
Httphandler runs in httpmodules.

Today, I posted the first part of Section 1. I talked about a request from the client to IIS and finally handled by httphandler. I feel that I have some knowledge about this part of the request process,
For ghost Application
The process of creating the class, that is, the details of creating the httpapplication object, is not very clear. I hope you can talk about this part and learn it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.