From 5527417afae062d7a2b12ee80730a0ab22b86eab Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 8 Dec 2011 16:14:30 +0100 Subject: sockets: new Curl_socket_check() can wait for 3 sockets This offers an alternative to the existing Curl_socket_ready() API which only checks one socket for read and one for write. --- lib/select.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/select.h') diff --git a/lib/select.h b/lib/select.h index 56729a3b2..b50604b0a 100644 --- a/lib/select.h +++ b/lib/select.h @@ -84,9 +84,19 @@ struct pollfd #define POLLRDBAND POLLPRI #endif -int Curl_socket_ready(curl_socket_t readfd, curl_socket_t writefd, +/* there are three CSELECT defines that are defined in the public header that + are exposed to users, but this *IN2 bit is only ever used internally and + therefore defined here */ +#define CURL_CSELECT_IN2 (CURL_CSELECT_ERR << 1) + +int Curl_socket_check(curl_socket_t readfd, curl_socket_t readfd2, + curl_socket_t writefd, long timeout_ms); +/* provide the former API internally */ +#define Curl_socket_ready(x,y,z) \ + Curl_socket_check(x, CURL_SOCKET_BAD, y, z) + int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms); int Curl_wait_ms(int timeout_ms); -- cgit v1.2.1