-#include <string.h>
#include "config.h"
+#include <stdio.h>
+#include <string.h>
/**
- * net - simple IPv4/IPv6 client library
+ * net - simple IPv4/IPv6 socket library
*
- * This code makes it simple to support IPv4 and IPv6 without speed penalty.
+ * This code makes it simple to support IPv4 and IPv6 without speed penalty
+ * in clients by using non-blocking simultaneous connect, and using
+ * a convenience function to create both IPv4 and IPv6 sockets for servers.
*
* License: MIT
*
*
* Example:
* #include <ccan/net/net.h>
- * #include <sys/types.h>
- * #include <sys/socket.h>
* #include <netinet/in.h>
* #include <stdio.h>
* #include <err.h>
* fd = net_connect(addr);
* if (fd < 0)
* err(1, "Failed to connect to %s", dest);
+ * freeaddrinfo(addr);
*
* if (getsockname(fd, &u.s, &slen) == 0)
* printf("Connected via %s\n",
return 1;
if (strcmp(argv[1], "depends") == 0) {
+ printf("ccan/noerr\n");
return 0;
}