diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-03-04 17:04:11 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-03-04 19:42:17 -0800 |
| commit | 23a38d766780f4749945d84316b4e0a71e707b15 (patch) | |
| tree | 336cf1bfc7c7e32999653a4c4014232d2b735a3e /tools | |
| parent | 0094f83a9e3b54d6cbfc1ea1885036366b87b991 (diff) | |
| download | nng-23a38d766780f4749945d84316b4e0a71e707b15.tar.gz nng-23a38d766780f4749945d84316b4e0a71e707b15.tar.bz2 nng-23a38d766780f4749945d84316b4e0a71e707b15.zip | |
fixes #262 NNG_OPT_URL should be resolved
This causes TCP, TLS, and ZT endpoints to resolve any
wildcards, and even IP addresses, when reporting the listen
URL. The dialer URL is reported unresolved. Test cases
for this are added as well, and nngcat actually reports this
if --verbose is supplied.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/nngcat/nngcat.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/nngcat/nngcat.c b/tools/nngcat/nngcat.c index 064e4635..7459c319 100644 --- a/tools/nngcat/nngcat.c +++ b/tools/nngcat/nngcat.c @@ -1008,6 +1008,15 @@ main(int ac, const char **av) } rv = nng_dialer_start(d, async); act = "dial"; + if ((rv == 0) && (verbose == OPT_VERBOSE)) { + char ustr[256]; + size_t sz; + sz = sizeof(ustr); + if (nng_dialer_getopt( + d, NNG_OPT_URL, ustr, &sz) == 0) { + printf("Connected to: %s\n", ustr); + } + } break; case OPT_LISTEN: case OPT_LISTEN_IPC: @@ -1027,6 +1036,15 @@ main(int ac, const char **av) } rv = nng_listener_start(l, async); act = "listen"; + if ((rv == 0) && (verbose == OPT_VERBOSE)) { + char ustr[256]; + size_t sz; + sz = sizeof(ustr); + if (nng_listener_getopt( + l, NNG_OPT_URL, ustr, &sz) == 0) { + printf("Listening at: %s\n", ustr); + } + } break; default: fatal("Invalid address mode! (Bug!)"); |
