summaryrefslogtreecommitdiff
path: root/lib/select.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-12-08 16:14:30 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-12-20 20:30:02 +0100
commit5527417afae062d7a2b12ee80730a0ab22b86eab (patch)
treec8f09b8df92bc00f34bae382ee470b3b340c0b24 /lib/select.h
parentbedfafe38e93677a72e9cd52fa60c4bc72bc5e01 (diff)
downloadcurl-5527417afae062d7a2b12ee80730a0ab22b86eab.tar.gz
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.
Diffstat (limited to 'lib/select.h')
-rw-r--r--lib/select.h12
1 files changed, 11 insertions, 1 deletions
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);