The HTTP Server API enables applications to communicate over HTTP without using Microsoft Internet Information Server (IIS). Applications can register to receive HTTP requests for particular URLs,receive HTTP requests,and send HTTP responses. The HTTP Server API includes SSL support so that applications can exchange data over secure HTTP connections without IIS. It is also designed to work with I/O completion ports.
找到这个很酷的,我仔细查看了两个版本的API的功能列表.现在,文档中提到I / O完成端口的唯一其他部分是HttpReceiveHttpRequest
()功能.最后一个参数是可选的OVERLAPPED
结构,具有以下描述:
For asynchronous calls,set
pOverlapped@H_404_12@ to point to an
OVERLAPPED@H_404_12@ structure; for synchronous calls,set it to
NULL@H_404_12@. A synchronous call blocks until a request has arrived in the specified queue and some or all of it has been retrieved,whereas an asynchronous call immediately returns
ERROR_IO_PENDING@H_404_12@ and the calling application then uses
GetOverlappedResult()@H_404_12@ or I/O completion ports to determine when the operation is completed. For more information about using OVERLAPPED structures for synchronization,see 07003.
没有其他信息,所有结构都是不透明的,故意隐藏连接信息.另请注意,同步和重叠输入和输出主题未提及HTTP API.
有没有人知道如何将HTTP API的队列连接到I / O完成端口?
“正常”用法是:
>调用CreateIOCompletionPort以创建IO完成端口句柄.
>创建一堆线程,并在调用GetOverlappedResult时让每个线程循环.当与端口关联的重叠操作完成时,GetOverlappedResult将返回,其中结构指示完成了哪个句柄和操作.
>当您的程序运行并创建它希望异步处理的对象时,它会通过再次调用CreateIOCompletionPort将每个HANDLE与IO CompletionPort句柄相关联.
现在,每次应用程序在HANDLE上发出异步操作时(通过传入OVERLAPPED结构信号),完成操作的通知将由等待GetOverlappedResult返回的其中一个线程指示.
明确的含义是HttpCreateRequestQueue返回的HANDLE可以与IO Completion端口关联,后续的异步操作将导致GetOverlappedResult返回操作的结果.