5 * oserver - a demonstration module for LCA2011
7 * This code shows off the features of CCAN and various C cantrips.
12 * #include <sys/types.h>
13 * #include <sys/socket.h>
14 * #include <ccan/oserver/oserver.h>
22 * sockfd = oserver_setup();
24 * err(1, "Failed to set up server socket");
26 * fd = accept(sockfd, NULL, NULL);
28 * err(1, "Accepting connection on TCP socket");
30 * if (!oserver_serve(fd))
31 * err(1, "Serving client");
35 int main(int argc, char *argv[])
37 /* Expect exactly one argument */
41 if (strcmp(argv[1], "depends") == 0) {
42 printf("ccan/read_write_all\n");
44 printf("ccan/foreach\n");
45 printf("ccan/noerr\n");
46 printf("ccan/failtest\n");