cURL
Haxx ad
libcurl

Shopping cart software, Online file storage, Online photo storage, Hosted shopping cart, Contact management software, Email marketing software, Project management software, Issue tracking software, Online notepad, Web publishing software

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Archives

Re: Is it possible to break the timeout of select call?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 24 Nov 2009 09:51:31 +0100 (CET)

On Tue, 24 Nov 2009, centrio_at_gmail.com wrote:

> I am calling select with 1 second timeout since I need to quite application
> on user request. I cannot have a large timeout since then user has to wait
> for that much time to quit. Basically I have main thread for UI and this
> select is in another thread. if I have a timeout of 1 min and the select
> call is waiting, then if user requests to quit the application then it
> hangs.

The traditional way of solving that without that kind of loop is to have the
select() also wait for a pipe to get readable, and then you write to the pipe
from the UI thread when you want to kill the transfer thread.

That way you won't have a 1 or 60 second delay.

> So I wanted to know if its same to have 1min timeout and to have 1sec
> timeout for 60 times.

Sure you can.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-24

These mail archives are generated by hypermail.

donate! Page updated November 16, 2009.
web site info

File upload with ASP.NET