diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-07 00:08:24 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-07 00:08:24 -0700 |
| commit | 3730260da3744b549aaa1fe13946a674f924f63c (patch) | |
| tree | 902866876ee71246a299370cbe8f6580d758525c /tests | |
| parent | 3b19940dfcd5d3585b1fb1dcf7915a748ae67289 (diff) | |
| download | nng-3730260da3744b549aaa1fe13946a674f924f63c.tar.gz nng-3730260da3744b549aaa1fe13946a674f924f63c.tar.bz2 nng-3730260da3744b549aaa1fe13946a674f924f63c.zip | |
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.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/resolv.c | 14 |
1 files changed, 11 insertions, 3 deletions
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); |
