Cassini source code analysis (5) -- Conclusion

Source: Internet
Author: User

After a preliminary look at all the code, we can see that:

1. execution flow. How is the Asp.net Program executed? The execution of an Asp.net application requires a host. After the host is established, the ability to execute the Asp.net application code is established. To execute an Asp.net request, you must use httpruntime. processrequest (simpleworkerrequest) is used to stimulate execution, while simpleworkerrequest needs to be overloaded to instantiate a complete HTTP request and provide it to the Asp.net Runtime Library for correct processing of user request context and user request data. Simpleworkerrequest is called in sequence according to HTTP specifications during Asp.net execution.

2. Http details. We didn't actually see that all the files such as HTTP Flood were executed by the runtime database, but the runtime database directly reads the file and returns it if it finds that it does not need to be executed. This is not the case for asp.netunder iisms. iissag will process its own registered extension file requests before asp_wp.exe. This result may be the same, but the actual difference is that the processing location of common files is different. Therefore, on the basis of Cassini, We can manually process some files that do not require dynamic parsing, reducing the burden on the Asp.net Runtime Library and improving efficiency.

Cassini is a Host Program of Asp.net and is not a complete Web server.

3. Asp.net is a completely new execution environment, not the script technology before the script. In addition to the basic framework,. Net also provides the ability to execute the ASPX page and corresponding components. Learning Cassini is to learn how to use this capability provided by the. NET Framework. Just like studying C code and learning how to program using Windows API.

4. We can select IIS as the host. However, after the ISAPI starts the Asp.net daemon process, the response is returned through the pipeline. After all, the data is transmitted between the two processes. Besides, IIS itself is also a big basket of vulnerabilities, there is no other need. We think it is highly efficient to implement the Asp.net host and execute the Asp.net application, and the application domain also provides security isolation.

5. Learn how to use multithreading to satisfy multi-threaded enterprise applications. The use of callback functions is also exquisite.

6. It makes sense for you to develop Web applications independent from IIS in the future. For example, you can use Asp.net to develop desktop auxiliary applications. Similar to htmlview applications. I have seen that some users can run desktop applications quickly by executing Asp.net (to facilitate the rapid expansion to multiple users in the future ).

Of course, I also have questions:

1. Why does threadpool cause blocking of concurrent access?

2. Can I create more independent Asp.net execution hosts by myself?

3. How to generate such a tool more commonly? I believe it can be more independent.

Welcome to contact my myjobsdk@yahoo.com.cn.

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.