aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSara Golemon <sgolemon@fb.com>2012-08-27 12:48:55 -0700
committerDaniel Stenberg <daniel@haxx.se>2012-09-01 23:10:53 +0200
commitde24d7bd4c03ea3eeba928edc9ae9e7a826c67c8 (patch)
tree19f1663d427c4f75c7f201d5841ce1c24d6b005c /include
parent2f6e1a8cc3f4573b29d48b7bd8177dbbc4c337fd (diff)
multi: add curl_multi_wait()
/* * Name: curl_multi_wait() * * Desc: Poll on all fds within a CURLM set as well as any * additional fds passed to the function. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms);
Diffstat (limited to 'include')
-rw-r--r--include/curl/multi.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/curl/multi.h b/include/curl/multi.h
index f96566669..737f17ce2 100644
--- a/include/curl/multi.h
+++ b/include/curl/multi.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -89,6 +89,19 @@ struct CURLMsg {
};
typedef struct CURLMsg CURLMsg;
+/* Based on poll(2) structure and values.
+ * We don't use pollfd and POLL* constants explicitly
+ * to cover platforms without poll(). */
+#define CURL_WAIT_POLLIN 0x0001
+#define CURL_WAIT_POLLPRI 0x0002
+#define CURL_WAIT_POLLOUT 0x0004
+
+struct curl_waitfd {
+ curl_socket_t fd;
+ short events;
+ short revents; /* not supported yet */
+};
+
/*
* Name: curl_multi_init()
*
@@ -133,6 +146,19 @@ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *exc_fd_set,
int *max_fd);
+/*
+ * Name: curl_multi_wait()
+ *
+ * Desc: Poll on all fds within a CURLM set as well as any
+ * additional fds passed to the function.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
+CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,
+ struct curl_waitfd extra_fds[],
+ unsigned int extra_nfds,
+ int timeout_ms);
+
/*
* Name: curl_multi_perform()
*