curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl multi + CURLOPT_INTERFACE + bind connection

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Mon, 4 Feb 2019 14:11:19 +0100 (CET)

On Mon, 4 Feb 2019, name via curl-library wrote:

> Can I rely on the CURLOPT_INTERFACE option to guaranteed binding (reuse)
> some connection?
>
> CURL* session1 = curl_easy_setopt(easy, CURLOPT_INTERFACE, "127.0.0.1");
> CURL* session2 = curl_easy_setopt(easy, CURLOPT_INTERFACE, "127.0.0.2");
>
> on repeated calls (exclude errors) will always be same, like:
>
> session1 re-use existing connection #1
> session2 re-use existing connection #2

Yes you can. Assuming of course that those IP addresses work to use as source
addresses.

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