How to make cURL reconnect
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.
If you're using HTTP connections, then HTTP does not have "reconnect." You have to create a new HTTP request and start that.
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?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement