aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-07-20 10:13:35 +0000
committerChristian Grothoff <christian@grothoff.org>2013-07-20 10:13:35 +0000
commit209021f4cc64d119a4ada715e90b59d273f21c74 (patch)
tree7eaba4f47ca9c9f52c4e670f750d2d731b56290e
parent81a04f09ce93a13f717d0029c05736bb56672eb2 (diff)
downloadlibmicrohttpd-209021f4cc64d119a4ada715e90b59d273f21c74.tar.gz
libmicrohttpd-209021f4cc64d119a4ada715e90b59d273f21c74.zip
-moving dual stack example to modern variant
-rw-r--r--src/examples/dual_stack_example.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/examples/dual_stack_example.c b/src/examples/dual_stack_example.c
index ff92e3c9..0436cbb3 100644
--- a/src/examples/dual_stack_example.c
+++ b/src/examples/dual_stack_example.c
@@ -57,29 +57,23 @@ ahc_echo (void *cls,
57 return ret; 57 return ret;
58} 58}
59 59
60
60int 61int
61main (int argc, char *const *argv) 62main (int argc, char *const *argv)
62{ 63{
63 struct MHD_Daemon *d4; 64 struct MHD_Daemon *d;
64 struct MHD_Daemon *d6;
65 65
66 if (argc != 2) 66 if (argc != 2)
67 { 67 {
68 printf ("%s PORT\n", argv[0]); 68 printf ("%s PORT\n", argv[0]);
69 return 1; 69 return 1;
70 } 70 }
71 d4 = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG, 71 d = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | MHD_USE_DUAL_STACK,
72 atoi (argv[1]), 72 atoi (argv[1]),
73 NULL, NULL, &ahc_echo, PAGE, 73 NULL, NULL, &ahc_echo, PAGE,
74 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
75 MHD_OPTION_END);
76 d6 = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_DEBUG | MHD_USE_IPv6,
77 atoi (argv[1]),
78 NULL, NULL, &ahc_echo, PAGE,
79 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120, 74 MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
80 MHD_OPTION_END); 75 MHD_OPTION_END);
81 (void) getc (stdin); 76 (void) getc (stdin);
82 MHD_stop_daemon (d4); 77 MHD_stop_daemon (d);
83 MHD_stop_daemon (d6);
84 return 0; 78 return 0;
85} 79}