On Thu, 7 Jan 2010, [email protected] wrote:

if (CONNECTIONSTATE_CONNECT == state)

#How does your program know/guess what state the handle is in?

Initially the application when receives a URL to connect to, its in Connect state. I switch to Data state once I get atleast one Data callback. (WRITE_DATA).

Ok, fair enough, but you cannot make assumptions on the significance of a timeout during the "connect" state like you did. Your "connect" state is doing a lot more than just connecting. Or put another way: your connect state involves a lot of different steps and network actions within libcurl.

I have a timeout of 1 second for select call on curl FD's. For some URLsThe select call returns before 1 second but no callbacks get called.

#That's normal and expected.

If select is returning before 1 second, (no timeout) then it mean it has returned because it has observed some change on FD's.

Exactly.

Now if some FD's have changed, callbacks should get called.

Not necessarily, no. But maybe.

My question is, why callbacks dont get called even if FD's have change?

Because there wasn't traffic enough to cause a callback to get called? What callback were you expecting that didn't get called?

--

 / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to