X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fnet%2F_info;h=cfa58f842830fd07ce4c89effa95e203e4248234;hb=b3cc8ae7c2fe35cf20bd0bac211658c0ecbdbdae;hp=a9c57206af368f1c7964fe50e0b41301738dcf99;hpb=708b846815c758645cf19f905513c67f7a024491;p=ccan diff --git a/ccan/net/_info b/ccan/net/_info index a9c57206..cfa58f84 100644 --- a/ccan/net/_info +++ b/ccan/net/_info @@ -1,10 +1,13 @@ -#include #include "config.h" +#include +#include /** - * 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 * @@ -12,8 +15,6 @@ * * Example: * #include - * #include - * #include * #include * #include * #include @@ -46,6 +47,7 @@ * 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", @@ -64,6 +66,7 @@ int main(int argc, char *argv[]) return 1; if (strcmp(argv[1], "depends") == 0) { + printf("ccan/noerr\n"); return 0; }