cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Explicitly closing sockets

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 22 Mar 2009 08:27:48 +0100 (CET)

On Sat, 21 Mar 2009, Chad Monroe wrote:

> Thanks for the quick response. The reason I continue to poll() on sockets
> "not used by libcurl any longer" is because curl_multi_fdset() returns them
> in the fd_set data even after the connection has finished. I assume this is
> because libcurl leaves the sockets open as denoted by the message:
>
> * Connection #0 to host 10.4.4.204 left intact
>
> I'm not sure if this is the intended behavior of curl_multi_fdset() or if
> it's possibly a bug. If you think it's an issue I can investigate further if
> you'd like.

The fact that the connection is left open simply means that it'll be kept in
the connection cache and thus is subject for a later re-use.
curl_multi_fdset() should only ever return socket bit about sockets that are
in active current use by an easy handle so if it truly returns info about a
socket no longer used it is definately an error and if you can produce a
sample app that shows this happening I'll be very interested!

-- 
  / daniel.haxx.se
Received on 2009-03-22