如何将您的应用程序注册到Http.sys? [英] How to register your application into\with Http.sys?

查看:171
本文介绍了如何将您的应用程序注册到Http.sys?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我创建了一个TCP \ HTTP服务器(IN C#).我想在我80年代的端口上给它命名空间,使其靠近我拥有的其他HTTP服务器.如何做这样的事情(逐步-逐步进行)?

So I created a TCP\HTTP server (IN C#). I want to give to it namespace on my 80's port near to other HTTP servers I have. How to do such thing (step - by step)?

推荐答案

查看

  • 初始化HTTP服务API,调用 HttpInitialize
  • 使用HTTP.SYS注册URL,调用 HttpAddUrlToUrlGroup
  • 接收请求,调用 HttpReceiveHttpRequest
  • 发送响应,致电 HttpSendHttpResponse
  • 自己清理后,调用 HttpRemoveUrl HttpTerminate
    • Initialize HTTP service API, call HttpInitialize
    • Register URLs with HTTP.SYS, call HttpAddUrlToUrlGroup
    • Receive a request, call HttpReceiveHttpRequest
    • Send a response, call HttpSendHttpResponse
    • Cleanup after urself, call HttpRemoveUrl and HttpTerminate

    您可以清楚地看到,HTTP.SYS API是供C应用程序使用的C API.您不应该在C#中使用它,我建议不要p调用整个API.托管应用程序可以选择使用 HTTP模块并扩展ASP.Net处理.该途径将处理托管服务器中所需的许多细节,例如激活,托管,过程监视和回收等等.

    As you can clearly see, HTTP.SYS API is a C API intended for C applications. You shouldn't be using it from C#, and I'd recommend against pInvoking the entire API. Managed applications have the alternative of using HTTP modules and extend the ASP.Net processing. This avenue will take care of many details needed in a managed server, like activation, hosting, process monitoring and recycling and so on and so forth.

    这篇关于如何将您的应用程序注册到Http.sys?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆