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/core/tcp.c | |
| 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/core/tcp.c')
| -rw-r--r-- | src/core/tcp.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/core/tcp.c b/src/core/tcp.c index e54cdee7..7fb67228 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -369,9 +369,6 @@ tcp_listener_alloc_addr(nng_stream_listener **lp, const nng_sockaddr *sa) tcp_listener *l; int rv; - if ((rv = nni_init()) != 0) { - return (rv); - } if ((l = NNI_ALLOC_STRUCT(l)) == NULL) { return (NNG_ENOMEM); } @@ -398,9 +395,6 @@ nni_tcp_listener_alloc(nng_stream_listener **lp, const nng_url *url) int rv; nng_sockaddr sa; - if ((rv = nni_init()) != 0) { - return (rv); - } if ((rv = nni_url_to_address(&sa, url)) != 0) { return (rv); } |
