cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl multi interface - handling abnormal disconnections

From: Jonathan Masters <jon_at_than.cc>
Date: Tue, 28 Jan 2014 09:28:47 +0000

On Mon, Jan 27, 2014 at 7:10 PM, Fabian Frank <fabian.frank.de_at_gmail.com> wrote:
>
> On Jan 27, 2014, at 3:28 AM, Jonathan Masters <jon_at_than.cc> wrote:
>> That's right, it's the reconnection which takes time, so I want to
>> reconnect and have the connection setup *before* the next time I need
>> to make a request. I don't want to only realise the connection is down
>> at the time the request comes in, which would mean I would have the
>> delay of connecting and the delay of the request.
>
> Instead of poking in the cURL code, it would probably be easier if you made a NOOP request to your server to achieve the same thing? If there is no > connection, curl will reconnect to do the noop. If there still is a connection, you just have a few bytes going back and forth (and you'd probably need > that anyway to be 100% sure the connection is still alive).

It would be easier to do a NOOP but currently I don't want to go down
that route due to the performance issues this may cause with the
server I am connecting to, it's embedded with not many resources. As
the connection is also over TLS it is more than just a few bytes and
the crypto does strain the server. It would be easier though :(

Thanks though

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-28