Skip to content

Commit

Permalink
Added comments about checking return code and the maxfd counter
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Oct 13, 2006
1 parent efe3cb6 commit f533476
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/examples/10-at-a-time.c
Expand Up @@ -123,6 +123,9 @@ int main(void)
return EXIT_FAILURE;
}

/* In a real-world program you OF COURSE check the return that maxfd is
bigger than -1 so that the call to select() below makes sense! */

if (curl_multi_timeout(cm, &L)) {
fprintf(stderr, "E: curl_multi_timeout\n");
return EXIT_FAILURE;
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/fopen.c
Expand Up @@ -153,6 +153,10 @@ fill_buffer(URL_FILE *file,int want,int waittime)
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);

/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1
so that the call to select() below makes sense! */

rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

switch(rc) {
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/multi-app.c
Expand Up @@ -80,6 +80,10 @@ int main(int argc, char **argv)
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);

/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1 so
that the call to select() below makes sense! */

rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

switch(rc) {
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/multi-debugcallback.c
Expand Up @@ -153,6 +153,10 @@ int main(int argc, char **argv)
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);

/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1
so that the call to select() below makes sense! */

rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

switch(rc) {
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/multi-double.c
Expand Up @@ -71,6 +71,10 @@ int main(int argc, char **argv)
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);

/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1 so
that the call to select() below makes sense! */

rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

switch(rc) {
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/multi-post.c
Expand Up @@ -93,6 +93,10 @@ int main(int argc, char *argv[])
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);

/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1
so that the call to select() below makes sense! */

rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

switch(rc) {
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/multi-single.c
Expand Up @@ -65,6 +65,10 @@ int main(int argc, char **argv)
/* get file descriptors from the transfers */
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);

/* In a real-world program you OF COURSE check the return code of the
function calls, *and* you make sure that maxfd is bigger than -1 so
that the call to select() below makes sense! */

rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);

switch(rc) {
Expand Down

0 comments on commit f533476

Please sign in to comment.