cURL / Mailing Lists / curl-library / Single Mail


Persistent connection problem on local ip address change.

From: Vijay Poliboyina <>
Date: Wed, 8 Jul 2009 12:18:34 -0400

   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.


   Is there a way to reliably detect socket error if the ip
address/network type changes and avoid reusing the connection? I don't
want to use the CURLOPT_FRESH_CONNECT option as the application itself
cannot reliably detect network changes. I might have a solution already
under way, I greatly appreciate other ideas.

Received on 2009-07-08