diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-09 23:45:21 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-11 11:03:12 -0800 |
| commit | 713b80f440cb414cd0b856bde0ea1b31f939777f (patch) | |
| tree | 1186c42418559c85719023bde3e919aa2df7fcef /src/tools/nngcat | |
| parent | cbe9a27ef7485977fbc7c713376b096b6723da3d (diff) | |
| download | nng-713b80f440cb414cd0b856bde0ea1b31f939777f.tar.gz nng-713b80f440cb414cd0b856bde0ea1b31f939777f.tar.bz2 nng-713b80f440cb414cd0b856bde0ea1b31f939777f.zip | |
refactor initialization/finalization
Applications must now call nng_init(), but they can supply
a set of parameters optionally. The code is now safe for
multiple libraries to do this concurrently, meaning nng_fini
no longer can race against another instance starting up.
The nni_init checks on all public APIs are removed now.
Diffstat (limited to 'src/tools/nngcat')
| -rw-r--r-- | src/tools/nngcat/nngcat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/nngcat/nngcat.c b/src/tools/nngcat/nngcat.c index 87f7c0a6..57bee3e5 100644 --- a/src/tools/nngcat/nngcat.c +++ b/src/tools/nngcat/nngcat.c @@ -723,6 +723,9 @@ main(int ac, char **av) addrend = &addrs; topicend = &topics; + nng_init(NULL); + atexit(nng_fini); + while ((rv = nng_opts_parse(ac, av, opts, &val, &arg, &idx)) == 0) { switch (val) { case OPT_HELP: |
