libcurl - multi_socket - 它是如何工作的 + 直接 IOCP?

libcurl - multi_socket - how it Working + directly IOCP?

我有一个基于 IO 完成端口的实现接口 Windows - 我想尝试将它与 libcurl 一起使用。

在线书籍卷曲说:

There are numerous event based systems to select from out there, and libcurl is completely agnostic to which one you use. libevent, libev and libuv are three popular ones but you can also go directly to your operating system's native solutions such as epoll, kqueue, /dev/poll, pollset, Event Completion or I/O Completion Ports.

我正在阅读有关多套接字的在线 Curl 书籍章节:"multi_socket" interface

它说:

libcurl informs the application about socket activity to wait for with a callback called CURLMOPT_SOCKETFUNCTION. Your application needs to implement such a function:

Using this, libcurl will set and remove sockets your application should monitor. Your application tells the underlying event-based system to wait for the sockets. This callback will be called multiple times if there are multiple sockets to wait for, and it will be called again when the status changes and perhaps you should switch from waiting for a writable socket to instead wait for it to become readable.

魔鬼自己也想不通它是如何工作的

-例如:

-创建完成端口:CreateIoCompletionPort()

-已创建完成端口处理程序:GetQueuedCompletionStatus()

-创建了一个windows异步套接字:WSASocket()

-填写所有必要的结构,如 - sockadrr

-连接到远程服务器:WSAConnect ()

-链接到 IO 完成端口的套接字。

-调用了 WSASend() 并发送到服务器消息。

-现在我希望 libcurl 从服务器读取消息并执行所有必要的操作,但我完全无法从描述中理解如何做到这一点???

libcurl informs the application about socket activity to wait for with a callback called CURLMOPT_SOCKETFUNCTION.

这个回调函数是怎么调用的?谁会打电话给她?在哪里 ?为什么,为什么??我不明白 ((((((

求求你帮忙:(

不幸的是 - Libcurl multi_socket 模式无法与 Windows IOCP 一起工作。