cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: WSAEventSelect and curl_multi_socket_action

From: Joshua Kwan <jkwan_at_vmware.com>
Date: Fri, 23 Oct 2009 08:17:50 -0700

On 10/23/09 08:00, "tom_at_ashok-art.com" <tom_at_ashok-art.com> wrote:
> Therefore, when curl_multi_socket_action returns and curl has
> registered an interest in writing to a particular socket, my program
> needs to know whether or not curl has just performed a send() call on
> that socket and had a return code of WSAEWOULDBLOCK. If it has done
> so, WSAEventSelect can be used. Otherwise, my program should
> immediately call curl_multi_socket_action again. As far as I can see
> there is no way I can tell which is the case.

Before dispatching to curl_multi_socket_action, you can try a 0-byte,
blocking send() on the socket to see if it is writable. If it returns
WSAEWOULDBLOCK, don't bother. If it passes, carry on with telling cURL that
it is writable.

-Josh

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