cURL / Mailing Lists / curl-library / Single Mail


Re: WSAEventSelect and curl_multi_socket_action

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

On 10/23/09 08:00, "" <> 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.


List admin:
Received on 2009-10-23