From 0260bd8f717a430e5327af4cce8f9431710ab233 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 4 Jan 2025 18:08:16 -0800 Subject: api: add nng_sock_send and nng_sock_recv These are the 2.0 equivalent versions of nng_send_aio and nng_recv_aio. The old names are preserved as aliases for the new. Applications can start adopting these with this release, even before 2.0 is ready. --- src/nng.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nng.c b/src/nng.c index ce559e82..529cd800 100644 --- a/src/nng.c +++ b/src/nng.c @@ -219,7 +219,7 @@ nng_sendmsg(nng_socket s, nng_msg *msg, int flags) } void -nng_recv_aio(nng_socket s, nng_aio *aio) +nng_sock_recv(nng_socket s, nng_aio *aio) { nni_sock *sock; int rv; @@ -235,7 +235,13 @@ nng_recv_aio(nng_socket s, nng_aio *aio) } void -nng_send_aio(nng_socket s, nng_aio *aio) +nng_recv_aio(nng_socket s, nng_aio *aio) +{ + nng_sock_recv(s, aio); +} + +void +nng_sock_send(nng_socket s, nng_aio *aio) { nni_sock *sock; int rv; @@ -256,6 +262,12 @@ nng_send_aio(nng_socket s, nng_aio *aio) nni_sock_rele(sock); } +void +nng_send_aio(nng_socket s, nng_aio *aio) +{ + nng_sock_send(s, aio); +} + int nng_ctx_open(nng_ctx *cp, nng_socket s) { -- cgit v1.2.3-70-g09d2