~ubuntu-branches/ubuntu/natty/curl/natty-proposed

« back to all changes in this revision

Viewing changes to docs/examples/10-at-a-time.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-05-24 21:12:19 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (3.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20090524211219-7jgcwuhl04ixuqsm
Tags: upstream-7.19.5
ImportĀ upstreamĀ versionĀ 7.19.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * $Id: 10-at-a-time.c,v 1.7 2008-05-22 21:20:07 danf Exp $
 
8
 * $Id: 10-at-a-time.c,v 1.9 2008-09-22 17:27:24 danf Exp $
9
9
 *
10
10
 * Example application source code using the multi interface to download many
11
11
 * files, but with a capped maximum amount of simultaneous transfers.
16
16
#include <errno.h>
17
17
#include <stdlib.h>
18
18
#include <string.h>
19
 
#include <unistd.h>
 
19
#ifndef WIN32
 
20
#  include <unistd.h>
 
21
#endif
20
22
#include <curl/multi.h>
21
 
#ifdef WIN32
22
 
#include <windows.h>
23
 
#endif
24
23
 
25
24
static const char *urls[] = {
26
25
  "http://www.microsoft.com",
114
113
 
115
114
  /* we can optionally limit the total amount of connections this multi handle
116
115
     uses */
117
 
  curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, MAX);
 
116
  curl_multi_setopt(cm, CURLMOPT_MAXCONNECTS, (long)MAX);
118
117
 
119
118
  for (C = 0; C < MAX; ++C) {
120
119
    init(cm, C);