cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: how to turn on persistent connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 11 Sep 2003 23:24:22 +0200 (CEST)

On Thu, 11 Sep 2003, Jerry G. Chiuan wrote:

> I used sniffer to check <port,ip> used by libcurl and found that it doesn't
> keep using the same connection ( port number changes for every new request )

It cannot re-use a connection to a different port number. A single connection
is fixed to the same port number.

> I do set header "Connection: Keep-Alive" and I believe my server also turn
> it on

Yes, each connection will be kept alive and re-used if possible.

> Do you guys know what is the problem?

Use the same host AND same port number and it'll work better!

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-09-12