64,685
社区成员
发帖
与我相关
我的任务
分享
1. Create a multi handle
2. Set the socket callback with CURLMOPT_SOCKETFUNCTION
3. Set the timeout callback with CURLMOPT_TIMERFUNCTION, to get to know what timeout value to use when waiting for socket activities.
4. Add easy handles with curl_multi_add_handle()
5. Provide some means to manage the sockets libcurl is using, so you can check them for activity. This can be done through your application code, or by way of an external library such as libevent or glib.
6. Call curl_multi_socket_action() to kickstart everything. To get one or more callbacks called.
7. Wait for activity on any of libcurl's sockets, use the timeout value your callback has been told
8, When activity is detected, call curl_multi_socket_action() for the socket(s) that got action. If no activity is detected and the timeout expires, call curl_multi_socket_action(3) with CURL_SOCKET_TIMEOUT