From 3730260da3744b549aaa1fe13946a674f924f63c Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 7 Jul 2017 00:08:24 -0700 Subject: TCP asynchronous working now. It turns out that I had to fix a number of subtle asynchronous handling bugs, but now TCP is fully asynchronous. We need to change the high-level dial and listen interfaces to be async as well. Some of the transport APIs have changed here, and I've elected to change what we expose to consumers as endpoints into seperate dialers and listeners. Under the hood they are the same, but it turns out that its helpful to know the intended use of the endpoint at initialization time. Scalability still occasionally hangs on Linux. Investigation pending. --- tests/resolv.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/resolv.c b/tests/resolv.c index 5ace327a..52a598dc 100644 --- a/tests/resolv.c +++ b/tests/resolv.c @@ -35,6 +35,12 @@ ip6str(void *addr) TestMain("TCP Resolver", { nni_init(); +// These work on Darwin, and should work on illumos, but they may +// depend on the local resolver configuration. We elect not to depend +// too much on them, since localhost can be configured weirdly. Notably +// the normal assumptions on Linux do *not* hold true. +#if 0 + Convey("Localhost IPv4 resolves", { nni_aio aio; const char *str; @@ -53,6 +59,7 @@ TestMain("TCP Resolver", { nni_aio_fini(&aio); } ); + Convey("Localhost IPv6 resolves", { nni_aio aio; memset(&aio, 0, sizeof (aio)); @@ -107,13 +114,14 @@ TestMain("TCP Resolver", { nni_aio_fini(&aio); } ); +#endif Convey("Google DNS IPv4 resolves", { nni_aio aio; const char *str; memset(&aio, 0, sizeof (aio)); nni_aio_init(&aio, NULL, NULL); nni_plat_tcp_resolv("google-public-dns-a.google.com", - "80", NNG_AF_INET, 1, &aio); + "80", NNG_AF_INET, 1, &aio); nni_aio_wait(&aio); So(nni_aio_result(&aio) == 0); So(aio.a_naddrs == 1); @@ -130,7 +138,7 @@ TestMain("TCP Resolver", { memset(&aio, 0, sizeof (aio)); nni_aio_init(&aio, NULL, NULL); nni_plat_tcp_resolv("8.8.4.4", - "80", NNG_AF_INET, 1, &aio); + "80", NNG_AF_INET, 1, &aio); nni_aio_wait(&aio); So(nni_aio_result(&aio) == 0); So(aio.a_naddrs == 1); @@ -147,7 +155,7 @@ TestMain("TCP Resolver", { memset(&aio, 0, sizeof (aio)); nni_aio_init(&aio, NULL, NULL); nni_plat_tcp_resolv("8.8.4.4", - "http", NNG_AF_INET, 1, &aio); + "http", NNG_AF_INET, 1, &aio); nni_aio_wait(&aio); So(nni_aio_result(&aio) == 0); So(aio.a_naddrs == 1); -- cgit v1.2.3-70-g09d2