Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: What use/example multi handle.
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Stef Bon via curl-users <curl-users_at_lists.haxx.se>
Date: Fri, 11 Feb 2022 04:43:39 +0100
Op do 10 feb. 2022 om 16:39 schreef Daniel Stenberg <daniel_at_haxx.se>:
>
> I'm not sure what you're asking here. It can do one, two, five or two hundred
> transfers. You decide!
My question is is a transfer here the same as a connection?
>
> > Is for every handle a socket created?
>
> Every concurrently ongoing transfer might use one or more sockets, yes. But an
> added transfer can sometimes use an existing connection (if HTTP/2 is used) so
> it doesn't always create another connection/socket.
>
Ok. What is the effect of the number of handles (created with
curl_easy_init(), and added with curl_multi_add_handle() ) on the
number of connections?
The way I look at it is that the context/application uses the handles,
and decides how many handles it uses (it is possible to do that a
dynamic way). libcurl decides to create one or more connections to
serve the requests. That may depend on the protocol used. Do I think
correct?
> > And I'm using my own eventloop, so I'm not using the curl wait and poll
> > functions.
The function associated with the configparameter
CURLMOPT_SOCKETFUNCTION is helpful I think here.
Stef
Date: Fri, 11 Feb 2022 04:43:39 +0100
Op do 10 feb. 2022 om 16:39 schreef Daniel Stenberg <daniel_at_haxx.se>:
>
> I'm not sure what you're asking here. It can do one, two, five or two hundred
> transfers. You decide!
My question is is a transfer here the same as a connection?
>
> > Is for every handle a socket created?
>
> Every concurrently ongoing transfer might use one or more sockets, yes. But an
> added transfer can sometimes use an existing connection (if HTTP/2 is used) so
> it doesn't always create another connection/socket.
>
Ok. What is the effect of the number of handles (created with
curl_easy_init(), and added with curl_multi_add_handle() ) on the
number of connections?
The way I look at it is that the context/application uses the handles,
and decides how many handles it uses (it is possible to do that a
dynamic way). libcurl decides to create one or more connections to
serve the requests. That may depend on the protocol used. Do I think
correct?
> > And I'm using my own eventloop, so I'm not using the curl wait and poll
> > functions.
The function associated with the configparameter
CURLMOPT_SOCKETFUNCTION is helpful I think here.
Stef
-- Unsubscribe: https://lists.haxx.se/listinfo/curl-users Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2022-02-11