Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make multiple curly instances maintain separate connections to same host? #394

Open
A-Posthuman opened this issue Sep 23, 2023 · 2 comments
Assignees
Labels

Comments

@A-Posthuman
Copy link

My program makes several curly instances to the same host, but for my use case I prefer that each curly instance maintain a separate SSL HTTP/2 connection, and then "stickily" reuse it. So ideally, there is 1 multiplexed HTTP/2 connection per curly instance, and the same curly instance reuses the same SSL connection - the connections don't get mixed up or used randomly between the curly instances.

Is this possible? When I turn on verbose mode I see messages initially appearing to indicate each new curly instance is making a new connection (I see different "#" connection numbers like 0, 1, and 2 if I make 3 curly instances. But then when I have verbose mode on subsequent requests among the different instances, they all seem to be using connection #0 ?

@JCMais
Copy link
Owner

JCMais commented Oct 30, 2023

sorry for the late reply, you are seeing this behavior because curly is just a wrapper on top of Curl, which is a wrap on top of the more "raw" libcurl APIs: Multi and Easy

The Curl clients (and thus the curly ones) will use a single Multi-instance for all their requests, to achieve what you want to do, you need multiple Multi instances.

Would it be helpful in your case if an option were added that sets the Multi-instance of the Curl/curly calls?

@JCMais JCMais self-assigned this Oct 30, 2023
@A-Posthuman
Copy link
Author

Yes such an option would definitely be helpful!

@JCMais JCMais added the feature label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants