cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: TCP_NODELAY

From: Joe Halpin <j.p.h_at_comcast.net>
Date: Mon, 29 Mar 2004 09:13:24 -0600

Seshubabu Pasam wrote:
>
> I just used 2 hrs as an example. AFAIK, there usually is nothing in the
> web server that drops the client connections, because of in-activity.
> The reason I asked for this is, we are trying to use libCurl for
> communication between a C client and a servlet container. We maintain a
> pool of curl handles open and we do not want them to timeout because of
> in-activity. Also adding this option should not hurt any application
> that uses curl, in any way.

I think you're misunderstanding what keepalive does. It's kind of a
misnomer actually. Setting keepalive will *cause* the connection to be
terminated if the link is down. If there are no acks outstanding,
keepalive will cause probes to be sent after the keepalive interval. If
the probes are not responded to within a certain period of time, TCP
will close the connection.

If it's not set, a quiescent connection will never go down, even if the
link does. If the link is up the connection should never go down either
way, unless the application closes the connection.

So it doesn't sound like you really want keepalive at all to me. I might
have misunderstood you though.

Joe
Received on 2004-03-29