diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-01 15:30:37 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-01 15:30:37 -0800 |
| commit | 3e6657600104c37bdefb8160ab983af0d37eeb7f (patch) | |
| tree | 9bb31179052bec8eadf71187834448d3402d04c1 /demo/reqrep | |
| parent | 59f6d721c62898b58c8ed434a839c8ab3ad9ee01 (diff) | |
| download | nng-3e6657600104c37bdefb8160ab983af0d37eeb7f.tar.gz nng-3e6657600104c37bdefb8160ab983af0d37eeb7f.tar.bz2 nng-3e6657600104c37bdefb8160ab983af0d37eeb7f.zip | |
demo: fix reqrep demo to use nng_init
Diffstat (limited to 'demo/reqrep')
| -rw-r--r-- | demo/reqrep/reqrep.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/demo/reqrep/reqrep.c b/demo/reqrep/reqrep.c index e390d523..5eb96266 100644 --- a/demo/reqrep/reqrep.c +++ b/demo/reqrep/reqrep.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2021 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -24,9 +24,6 @@ #include <time.h> #include <nng/nng.h> -#include <nng/protocol/reqrep0/rep.h> -#include <nng/protocol/reqrep0/req.h> -#include <nng/supplemental/util/platform.h> #define CLIENT "client" #define SERVER "server" @@ -76,6 +73,9 @@ server(const char *url) int rv; int count = 0; + if ((rv = nng_init(NULL)) != 0) { + fatal("nng_init", rv); + } if ((rv = nng_rep0_open(&sock)) != 0) { fatal("nng_rep0_open", rv); } @@ -134,6 +134,9 @@ client(const char *url) PUT64(cmd, DATECMD); + if ((rv = nng_init(NULL)) != 0) { + fatal("nng_init", rv); + } if ((rv = nng_req0_open(&sock)) != 0) { fatal("nng_socket", rv); } |
