curl-library
Fwd: Specific questions on curl_multi_perform and curl_socket_action
Date: Thu, 15 Dec 2011 17:34:06 +0400
---------- Forwarded message ----------
From: sandeep a <sandeep.a.sastry_at_gmail.com>
Date: Thu, Dec 15, 2011 at 5:28 PM
Subject: Specific questions on curl_multi_perform and curl_socket_action
To: libcurl development <curl-library_at_cool.haxx.se>
Hello,
I recently started moving from synchronous curl easy handle approach to the
asynchronous way using curl multi handle.
But I am stuck with some questions before finally making a choice between
curl multi perform and curl socket action.
My questions are as below:
1) Nature of my application: My application always would want to have
a fixed number of connections all the time (may be 10 to 15 connections).
Nature of the server is that of a file uploader or downloader.
What would be best to select? Curl_multi_perform or curl_socket_action
approach?
2) I can see form the man page of curl_socket_action, it says
application or external library (libevent or glib) has to check for
activity on sockets. How is this different from select based approach used
by curl_multi_perform, as libevent internally uses select.
3) When curl calls the callback set with CURLMOPT_SOCKETFUNCTION, what
is the necessity of setting another callback with libevent library? How
different are these two call backs?
4) And my basic doubt is, what is the socket data structure’s
significance here. I understand we create a job(may be a url to upload or
download) and assign the job to curl handle, and the curl handle takes care
of all http communication. So what is the role of socket data structure
here. I could not completely understand its significance from the examples.
Please share your valuable comments.
Thanks,
-Sandeep
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-15