cURL / Mailing Lists / curl-library / Single Mail

curl-library

dose we need a curl_mulit_perform_nonblock?

From: Sun Yi Ming <yimings_at_cgogo.com>
Date: Mon, 06 Feb 2006 19:46:05 +0800

hi guys,
   The easy handles in multi stack roughly can divided into two types,
one that are waiting on some socket events, while the other can be
performed non-block-ly (probably!). New added easy handles sure fall
into the nonblockly group and in some occasion the handle can became NB
again. I even guess i would program in this model:
    for(;;) {
       curl_multi_perform_nonblock(); /* do those not registered fd
events */
       poll(); /* wait events */
       curl_multi_socket(); /* do those satisfy
events */
    }
   Added a nwaiting_sockets field to struct Curl_easy_handle, then the
curl_multi_perform_nonblock can traverse the handles list to find
non-block-ed handles by checking this field. Imaging there are serveral
thousand handles in multi stack perhaps we need a explict non-block-ed
handles list.
   I attached a patch to solid my thoughts, the patch should apply to
the cvs src after hiper-8.patch applied, also have a test file thiper.c
just with slightly different to shiper.c. The patch is just for
demostration, hopefully would give some useful hints to Daniel and
perhaps the devel team. While i am always expecting Daniel's official
patch, i am willing to contrib my time to libcurl for testing and bug
fixing.

Sun Yi Ming

--
you can logout any time you like,
but you can never leave...


Received on 2006-02-06