aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/tcp/tcp_test.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-23 08:55:21 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-23 09:40:32 -0800
commit8f29c19954b7e4f0e47036b37b36ab9cd386ad70 (patch)
tree535b12c11e1049f80edd4b7b5564c8e3ebcfb07d /src/sp/transport/tcp/tcp_test.c
parentd1a0201e25ca2bf1d28c753aef47795144733b8d (diff)
downloadnng-8f29c19954b7e4f0e47036b37b36ab9cd386ad70.tar.gz
nng-8f29c19954b7e4f0e47036b37b36ab9cd386ad70.tar.bz2
nng-8f29c19954b7e4f0e47036b37b36ab9cd386ad70.zip
dialers: add nng_dial_url and nng_dialer_create_url
This allows a URL object to be used for dialing, which may be easier than using a string if you already have the URL object.
Diffstat (limited to 'src/sp/transport/tcp/tcp_test.c')
-rw-r--r--src/sp/transport/tcp/tcp_test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sp/transport/tcp/tcp_test.c b/src/sp/transport/tcp/tcp_test.c
index a95e48e7..82abcae1 100644
--- a/src/sp/transport/tcp/tcp_test.c
+++ b/src/sp/transport/tcp/tcp_test.c
@@ -172,10 +172,14 @@ test_tcp_keep_alive_option(void)
bool v;
int x;
char *addr;
+ nng_url *url;
NUTS_ADDR(addr, "tcp");
+ // next cases are just to exercise nng_dialer_create_url
+ NUTS_PASS(nng_url_parse(&url, addr));
NUTS_OPEN(s);
- NUTS_PASS(nng_dialer_create(&d, s, addr));
+ NUTS_PASS(nng_dialer_create_url(&d, s, url));
+ nng_url_free(url);
NUTS_PASS(nng_dialer_get_bool(d, NNG_OPT_TCP_KEEPALIVE, &v));
NUTS_TRUE(v == false);
NUTS_PASS(nng_dialer_set_bool(d, NNG_OPT_TCP_KEEPALIVE, true));