curl-library
RE: using WSAEventSelect with curl multi
Date: Tue, 01 Dec 2009 16:37:00 +0200
>The multi interface is not blocking...
Right sorry, I was using multi with curl_multi_fdset and select (code from the fopen.c sample), which made the code achieve blocking.
>Why? Oh, is that because you only can select() on sockets in windows and
>you want to wait for that quit command using some other means?
>
>Isn't WaitForMultipleObjects() however just a different select call so that
>it can wait for a number of sockets and some other file handles?
Right in windows select works only on sockets, and WaitForMultipleObjects work on other handles. This is why I want to use WSAEventSelect which associates (I think) a socket with an event (that can be then used with WaitForMultipleObjects)
>Yes, you can set those but if you want the "raw" sockets you must use the
>curl_multi_socket_action() function instead of curl_multi_perform().
I forgot to mention that I'm doing HTTP GET, not raw socket.
>(I'll appreciate patches!)
Since I'm not very familiar with curl, I prefer not to make any faulty patches, also the samples use libevent which I don't have I'm using only windows.
>So do they wait for the sockets the correct way? If so, why don't they >return?
>Don't the socket(s) get any action? If they do, isn't that a sign you don't
>wait for them the correct way? If they don't, isn't that a sign something
>is seriously wrong?
I'm not sure if I'm using curl the correct way (curl_multi_preform vs curl_multi_socket_action vs curl_multi_socket_all), and I'm not sure I'm using Win32 API correctly (WSAEventSelect).
This is why I ask if someone has a sample that does what I'm trying to do (on windows)
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-12-01