curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: can't go ahead if event isn't finished in libevent

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 2 May 2017 13:33:51 +0200 (CEST)

On Tue, 2 May 2017, Pahome Chen wrote:

> I thought it will call multi_timer_cb when called curl_multi_add_handle
> immediately like below:
>
> rc = curl_multi_add_handle
> <https://curl.haxx.se/libcurl/c/curl_multi_add_handle.html>(g->multi,
> conn->easy);
> mcode_or_die(*"new_conn: curl_multi_add_handle"*, rc);
>
> */* note that the add_handle() will set a time-out to trigger very soon so
> that the necessary socket_action() call will be called by this app */ *

libcurl calls the timer callback to inform your application that it wants a
new timer set so that you can tell libcurl when that timer has expired.

> so socket_action() will wait for exiting event loop in a blocking way?

curl_multi_socket_action() doesn't wait for events at all, your application
calls that after it noticed an event on a socket that libcurl asked your
application to "monitor".

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2017-05-02