curl-library
Re: Problem when I use libcurl to write and libevent to listen on a socket
Date: Sat, 01 Sep 2012 20:12:05 -0600
Hello Daniel,
Thank you for the reply and I'm sorry if you found my comment snarky, I
though it shows that I'm very cool :p
> But knowing when the full GET request has been sent is not necessarily
> something easily figured out
You are right. I give each connection one EV_WRITE chance and all the
time that I was testing it was enough to write the whole GET
request. Maybe with slower Internet connection, this will bite me back.
> What are you suggesting we should add to that man page to clarify?
I think something like your sentence makes it much clearer:
"It is not a guarantee that libcurl won't do other stuff that it thinks
is necessary."
But now it raises the question that what's the point of having "action"
argument for socket_multi_action at all:
- If the action is not necessary and you call m_s_a with that specific
action nothing happens.
- If libevent tells me the action is necessary and I call m_s_a without
that action, libcurl will take care of it (at least eventually)
anyway.
- If the action is necessary and I call it the action, you say there is
no guarantee that the job be completed at that call.
So what's the point? why not just wait for some event and in the
callback, call multi_socket_action without any action and it seems to
me that everything will be the same (maybe some timing different but we
have no control over the time anyway). So, isn't "action" totally
redundant, beside it gives users like me the illusion that they have
control and lead them writing crazy unstable code?
Thanks again for being patient with me.
Bests,
vmon
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-02