cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Persistent connection problem on local ip address change.

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 11 Jul 2009 20:08:48 +0200 (CEST)

On Wed, 8 Jul 2009, Vijay Poliboyina wrote:

> I am working on a linux platform with both wired and wireless interfaces.
> We are using libcurl multi interface to handle url requests and this is
> causing problems with the reuse of connections. If the network interface
> type (or ip address) is changed after a few transfers, a new request often
> tries to reuse the existing connection causing a timeout and reconnect. I
> think this is because select()/poll() calls used in the dead socket
> detection code cannot detect a socket error if the local ip address changes.

I figure we might need some way to detect if the same local IP and type would
be used as was used for the cached connection before it re-uses it.

> Is there a way to reliably detect socket error if the ip address/network
> type changes and avoid reusing the connection?

If the network interface changed address then the connection must be "dead"
and then I don't quite understand why the current approach doesn't detect
that.

-- 
  / daniel.haxx.se
Received on 2009-07-11