cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Error in select().. returns -1

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Oct 2011 14:15:36 +0200 (CEST)

On Wed, 19 Oct 2011, ketrio juki wrote:

>> Are you suggesting a difference between waiting and sleeping?
>
> No Daniel, i'm trying to understand what should i do.. could be a good
> solution the one in the example? Do you have a better solution and an
> example to show it?

I'm trying to explain in words how things work and why and what you can do
about it in your code. Then you can decide for yourself how you want to
convert that into code in your own application. I don't mandate exactly what
the best approach is, since I don't really claim to know it for all specific
cases. If you understand the situation I think you should be able to form your
own opinion!

In the (updated) man page I explicitly say that when max_fd is -1 you should
probably wait a short while instead - as if you don't you'll likely end up
busylooping and that's generally not what you want. A wait is often done by
some sort of sleep call. The 10-at-a-time.c example does exactly what I
suggest.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-19