• Advertisement
Sign in to follow this  

How to make cURL reconnect

This topic is 1908 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know how to do this? I'm using the library in C++ and I'm trying to get it to reconnect if the internet connection is lost. I've been testing by disabling the network adapter in windows, starting my game, trying to connect (and obviously failing) and then enabling the network adapter and trying to connect again. All of this while running the game the whole time. The problem is that cURL returns error code 60 when I try to run perform. Even though an internet connection is available now. I'm usig the "easy" set pf functions.

Share this post


Link to post
Share on other sites
Advertisement
Do you mean create new curl handle? I only have one handle that I've been storing and reusing. Am I supposed to be creating a new one for each request?

Share this post


Link to post
Share on other sites
If I remember right, once a connection is dead, you have to create a new one. So, try that. It's been a while since I used libcurl, so the details are fuzzy.
The HTTP protocol (version 1.1) allows a single TCP connection to be re-used for multiple HTTP requests, but once that TCP connection is dead, you cannot re-use it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement