cURL / Mailing Lists / curl-library / Single Mail

curl-library

Using curl_multi interface with epoll

From: Yehezkel Horowitz <horowity_at_checkpoint.com>
Date: Sun, 6 Nov 2011 20:38:12 +0200

Hi

This is my fist post to this list, so I want to use this opportunity to thanks all of you (mainly Daniel) for the development, maintenance and support efforts you invest on this amazing tool "cUrl".

Now for business:
I want to use curl_multi interface along with epoll (can't use select since I want to perform much more than 1024 requests in parallel).

My problem is that I can't get the "new" sockets that I need to add to the epoll_ctl, just the whole set of fds (by using curl_multi_fdset).

I tried to overcome this problem my managing two "multi" handle:
1. easy handles that I configured to use CURLOPT_CONNECT_ONLY (expected to be only few at a time)
2. easy handles that actually perform the job (most of them) - same easy handle from first list, just I re-use them.

My plan was to move the easy handle from the first list to the second after it finished the connect phase, and to use CURLINFO_LASTSOCKET to get the socket I need to add to epoll.
Also I'll need to perform periodic calls to curl_mutli_perform on the first list (not perfect solution, but fit my requirements).

Sadly I figured that when you remove the easy handle from associated multi handle it get lost all its open connections :-(

How should I proceed? Is there an option to get my goal (use more than 1024 easy handles in parallel with curl_multi interface)?

Take into account - my goal is to have ~20K connections opened in parallel.

Thanks in advanced

Yehezkel Horowitz
Check Point Software Technologies Ltd.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-06