cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: connect error reporting

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 12 May 2004 12:58:51 +0200 (CEST)

On Wed, 12 May 2004, Gisle Vanem wrote:

> > AFAICS, since connect() is non-blocking, the error must be obtained from
> > getsockopt(..SO_ERROR), but verifyconnect() doesn't do this on Windows.
> > Not sure why that is ifdef'ed out, but that function works fine here.

The function is not doing anything on Windows because:

1. Windows' connects don't need to be "verified" with this function.

2. When using many threads on windows, this function call becomes a bottle-
   neck. It takes nearly all CPU time, as discussed and researched by Andrew
   Fuller back in October 2003.

So, I take it we can use getsockopt() to get the error in case of failure, but
I think we should avoid calling it just to verify the connect as is needed on
non-windows platforms.

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-05-12