aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/reqrep0
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-03 12:46:33 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-04 09:48:44 -0800
commit57e736b5be2052484eec44889586bd89a2724c71 (patch)
treef579d2863d7d31e202f083ab6d5f5fe85651e64c /src/sp/protocol/reqrep0
parentcefc6e1995f7f8e53e16db745eac7a86c2ebffd3 (diff)
downloadnng-57e736b5be2052484eec44889586bd89a2724c71.tar.gz
nng-57e736b5be2052484eec44889586bd89a2724c71.tar.bz2
nng-57e736b5be2052484eec44889586bd89a2724c71.zip
api: rename nng_send_aio and nng_recv_aio to nng_socket_send and nng_socket_recv
This aligns more closely with the nng_ctx functions.
Diffstat (limited to 'src/sp/protocol/reqrep0')
-rw-r--r--src/sp/protocol/reqrep0/rep_test.c18
-rw-r--r--src/sp/protocol/reqrep0/req_test.c6
-rw-r--r--src/sp/protocol/reqrep0/reqstress_test.c16
-rw-r--r--src/sp/protocol/reqrep0/xrep_test.c6
-rw-r--r--src/sp/protocol/reqrep0/xreq_test.c4
5 files changed, 25 insertions, 25 deletions
diff --git a/src/sp/protocol/reqrep0/rep_test.c b/src/sp/protocol/reqrep0/rep_test.c
index 29c5ee4c..7c788d96 100644
--- a/src/sp/protocol/reqrep0/rep_test.c
+++ b/src/sp/protocol/reqrep0/rep_test.c
@@ -163,8 +163,8 @@ test_rep_double_recv(void)
NUTS_PASS(nng_aio_alloc(&aio1, NULL, NULL));
NUTS_PASS(nng_aio_alloc(&aio2, NULL, NULL));
- nng_recv_aio(s1, aio1);
- nng_recv_aio(s1, aio2);
+ nng_socket_recv(s1, aio1);
+ nng_socket_recv(s1, aio2);
nng_aio_wait(aio2);
NUTS_FAIL(nng_aio_result(aio2), NNG_ESTATE);
@@ -203,12 +203,12 @@ test_rep_huge_send(void)
NUTS_SEND(req, "R");
NUTS_RECV(rep, "R");
nng_aio_set_msg(aio, m);
- nng_send_aio(rep, aio);
+ nng_socket_send(rep, aio);
nng_aio_wait(aio);
NUTS_PASS(nng_aio_result(aio));
nng_aio_set_msg(aio, NULL);
m = NULL;
- nng_recv_aio(req, aio);
+ nng_socket_recv(req, aio);
nng_aio_wait(aio);
NUTS_PASS(nng_aio_result(aio));
m = nng_aio_get_msg(aio);
@@ -260,12 +260,12 @@ test_rep_huge_send_socket(void)
NUTS_SEND(req, "R");
NUTS_RECV(rep, "R");
nng_aio_set_msg(aio, m);
- nng_send_aio(rep, aio);
+ nng_socket_send(rep, aio);
nng_aio_wait(aio);
NUTS_PASS(nng_aio_result(aio));
nng_aio_set_msg(aio, NULL);
m = NULL;
- nng_recv_aio(req, aio);
+ nng_socket_recv(req, aio);
nng_aio_wait(aio);
NUTS_PASS(nng_aio_result(aio));
m = nng_aio_get_msg(aio);
@@ -306,7 +306,7 @@ test_rep_close_pipe_before_send(void)
NUTS_MARRY(req, rep);
NUTS_SEND(req, "test");
- nng_recv_aio(rep, aio1);
+ nng_socket_recv(rep, aio1);
nng_aio_wait(aio1);
NUTS_PASS(nng_aio_result(aio1));
NUTS_TRUE((m = nng_aio_get_msg(aio1)) != NULL);
@@ -531,7 +531,7 @@ test_rep_close_recv(void)
NUTS_MARRY(req, rep);
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
- nng_recv_aio(rep, aio);
+ nng_socket_recv(rep, aio);
NUTS_CLOSE(rep);
NUTS_CLOSE(req);
nng_aio_wait(aio);
@@ -580,7 +580,7 @@ test_rep_close_recv_cb(void)
NUTS_MARRY(req, rep);
NUTS_PASS(nng_aio_alloc(&state.aio, rep_close_recv_cb, &state));
- nng_recv_aio(rep, state.aio);
+ nng_socket_recv(rep, state.aio);
NUTS_CLOSE(rep);
NUTS_CLOSE(req);
nng_mtx_lock(state.mtx);
diff --git a/src/sp/protocol/reqrep0/req_test.c b/src/sp/protocol/reqrep0/req_test.c
index 13bab6ec..17378c89 100644
--- a/src/sp/protocol/reqrep0/req_test.c
+++ b/src/sp/protocol/reqrep0/req_test.c
@@ -337,7 +337,7 @@ test_req_disconnect_abort(void)
NUTS_MARRY(rep1, req);
NUTS_SEND(req, "ping");
NUTS_RECV(rep1, "ping");
- nng_recv_aio(req, aio);
+ nng_socket_recv(req, aio);
NUTS_MARRY(rep2, req);
NUTS_CLOSE(rep1);
@@ -433,7 +433,7 @@ test_req_cancel_abort_recv(void)
NUTS_SLEEP(100);
nng_aio_set_timeout(aio, 5 * SECOND);
- nng_recv_aio(req, aio);
+ nng_socket_recv(req, aio);
// Give time for this recv to post properly.
NUTS_SLEEP(100);
@@ -565,7 +565,7 @@ test_req_poll_contention(void)
NUTS_TRUE(nuts_poll_fd(fd) == false);
nng_aio_set_msg(aio, msg);
- nng_send_aio(req, aio);
+ nng_socket_send(req, aio);
for (int i = 0; i < 5; i++) {
nng_aio_set_msg(ctx_aio[i], ctx_msg[i]);
nng_ctx_send(ctx[i], ctx_aio[i]);
diff --git a/src/sp/protocol/reqrep0/reqstress_test.c b/src/sp/protocol/reqrep0/reqstress_test.c
index 9c0861d8..2b2e1980 100644
--- a/src/sp/protocol/reqrep0/reqstress_test.c
+++ b/src/sp/protocol/reqrep0/reqstress_test.c
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -12,9 +12,9 @@
#include <string.h>
#include <time.h>
-#include <nng/nng.h>
+#include "nng/nng.h"
-#include <nuts.h>
+#include "nuts.h"
#ifdef NDEBUG
#define dprintf(...)
@@ -114,7 +114,7 @@ rep_recv_cb(void *arg)
c->nrecv++;
nng_aio_set_msg(c->send_aio, nng_aio_get_msg(c->recv_aio));
nng_aio_set_msg(c->recv_aio, NULL);
- nng_send_aio(c->socket, c->send_aio);
+ nng_socket_send(c->socket, c->send_aio);
}
static void
@@ -130,7 +130,7 @@ rep_send_cb(void *arg)
return;
}
c->nsend++;
- nng_recv_aio(c->socket, c->recv_aio);
+ nng_socket_recv(c->socket, c->recv_aio);
}
static void
@@ -153,7 +153,7 @@ req_time_cb(void *arg)
return;
}
nng_aio_set_msg(c->send_aio, msg);
- nng_send_aio(c->socket, c->send_aio);
+ nng_socket_send(c->socket, c->send_aio);
}
static void
@@ -196,7 +196,7 @@ req_send_cb(void *arg)
return;
}
c->nsend++;
- nng_recv_aio(c->socket, c->recv_aio);
+ nng_socket_recv(c->socket, c->recv_aio);
}
void
@@ -224,7 +224,7 @@ reqrep_test(int ntests)
fatal("nng_aio_alloc", rv);
}
- nng_recv_aio(srv->socket, srv->recv_aio);
+ nng_socket_recv(srv->socket, srv->recv_aio);
for (i = 1; i < ntests; i++) {
cli = &cases[curcase++];
diff --git a/src/sp/protocol/reqrep0/xrep_test.c b/src/sp/protocol/reqrep0/xrep_test.c
index a00f78f7..d4e4ce26 100644
--- a/src/sp/protocol/reqrep0/xrep_test.c
+++ b/src/sp/protocol/reqrep0/xrep_test.c
@@ -171,7 +171,7 @@ test_xrep_close_pipe_before_send(void)
NUTS_MARRY(req, rep);
NUTS_SEND(req, "test");
- nng_recv_aio(rep, aio1);
+ nng_socket_recv(rep, aio1);
nng_aio_wait(aio1);
NUTS_PASS(nng_aio_result(aio1));
NUTS_TRUE((m = nng_aio_get_msg(aio1)) != NULL);
@@ -265,7 +265,7 @@ test_xrep_recv_aio_stopped(void)
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
nng_aio_stop(aio);
- nng_recv_aio(rep, aio);
+ nng_socket_recv(rep, aio);
nng_aio_wait(aio);
NUTS_FAIL(nng_aio_result(aio), NNG_ESTOPPED);
NUTS_CLOSE(rep);
@@ -281,7 +281,7 @@ test_xrep_recv_aio_canceled(void)
NUTS_PASS(nng_rep0_open_raw(&rep));
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
- nng_recv_aio(rep, aio);
+ nng_socket_recv(rep, aio);
nng_aio_cancel(aio);
nng_aio_wait(aio);
NUTS_FAIL(nng_aio_result(aio), NNG_ECANCELED);
diff --git a/src/sp/protocol/reqrep0/xreq_test.c b/src/sp/protocol/reqrep0/xreq_test.c
index 28c79a26..7969ff0f 100644
--- a/src/sp/protocol/reqrep0/xreq_test.c
+++ b/src/sp/protocol/reqrep0/xreq_test.c
@@ -171,7 +171,7 @@ test_xreq_recv_aio_stopped(void)
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
nng_aio_stop(aio);
- nng_recv_aio(req, aio);
+ nng_socket_recv(req, aio);
nng_aio_wait(aio);
NUTS_FAIL(nng_aio_result(aio), NNG_ESTOPPED);
NUTS_CLOSE(req);
@@ -190,7 +190,7 @@ test_xreq_send_aio_canceled(void)
NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
nng_aio_set_msg(aio, msg);
- nng_send_aio(req, aio);
+ nng_socket_send(req, aio);
nng_aio_cancel(aio);
nng_aio_wait(aio);
NUTS_FAIL(nng_aio_result(aio), NNG_ECANCELED);