From d64f12553eb6ceb67ed6f6a5b2ceb6c061d375ba Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 8 Aug 2017 21:19:09 -0700 Subject: fixes #44 open protocol by "name" (symbol) instead number fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.) --- tests/scalability.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/scalability.c') diff --git a/tests/scalability.c b/tests/scalability.c index 1e0ea2a9..e9422f8e 100644 --- a/tests/scalability.c +++ b/tests/scalability.c @@ -43,7 +43,7 @@ openclients(nng_socket *clients, int num) int i; uint64_t t; for (i = 0; i < num; i++) { - if ((rv = nng_open(&clients[i], NNG_PROTO_REQ)) != 0) { + if ((rv = nng_req_open(&clients[i])) != 0) { printf("open #%d: %s\n", i, nng_strerror(rv)); return (rv); } @@ -120,7 +120,7 @@ Main({ clients = calloc(nclients, sizeof(nng_socket)); results = calloc(nclients, sizeof(int)); - if ((nng_open(&rep, NNG_PROTO_REP) != 0) || + if ((nng_rep_open(&rep) != 0) || (nng_setopt(rep, NNG_OPT_RCVBUF, &depth, sizeof(depth)) != 0) || (nng_setopt(rep, NNG_OPT_SNDBUF, &depth, sizeof(depth)) != 0) || (nng_listen(rep, addr, NULL, NNG_FLAG_SYNCH) != 0) || -- cgit v1.2.3-70-g09d2