aboutsummaryrefslogtreecommitdiff
path: root/demo/async/client.c
diff options
context:
space:
mode:
authorBrian Carcich <briantcarcich@gmail.com>2024-02-07 17:32:33 -0500
committerGarrett D'Amore <garrett@damore.org>2024-12-31 00:36:01 -0800
commit292e0a68516f1d5833e4bef582457113a939a9ef (patch)
tree171ac1e43308cfaaddd5e0d0fbd8c934cc6a1925 /demo/async/client.c
parent979d88e8d09f5db265f0f677f66efbef7a346a0e (diff)
downloadnng-292e0a68516f1d5833e4bef582457113a939a9ef.tar.gz
nng-292e0a68516f1d5833e4bef582457113a939a9ef.tar.bz2
nng-292e0a68516f1d5833e4bef582457113a939a9ef.zip
Enhance demo/async/ to allow async dial by client
demo/async/client.c - Enable client, on dial, to wait for server that has not yet started demo/async/arun.sh - Run async demo with arbitrary start order of server wrt clients
Diffstat (limited to 'demo/async/client.c')
-rw-r--r--demo/async/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/demo/async/client.c b/demo/async/client.c
index 90fce164..33ab9b36 100644
--- a/demo/async/client.c
+++ b/demo/async/client.c
@@ -53,7 +53,8 @@ client(const char *url, const char *msecstr)
fatal("nng_req0_open", rv);
}
- if ((rv = nng_dial(sock, url, NULL, 0)) != 0) {
+ if ((rv = nng_dial(sock, url, NULL,
+ getenv("NONBLOCK") ? NNG_FLAG_NONBLOCK : 0)) != 0) {
fatal("nng_dial", rv);
}