aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-02 23:54:27 -0700
committerGarrett D'Amore <garrett@damore.org>2024-11-02 23:54:27 -0700
commit02ec0b55cbee5de4d0fd688ce0ebddf08178dc98 (patch)
tree6cb65f860f8f9992b14139f52bf065c48f7b5a58 /src/nng.c
parent8bac5ccdf1de7334311459b9e2666e74a2c16c15 (diff)
downloadnng-02ec0b55cbee5de4d0fd688ce0ebddf08178dc98.tar.gz
nng-02ec0b55cbee5de4d0fd688ce0ebddf08178dc98.tar.bz2
nng-02ec0b55cbee5de4d0fd688ce0ebddf08178dc98.zip
Replace `NNG_OPT_RAW` with `nng_socket_raw`.
Similar to the other identities, this simplifies code a bit.
Diffstat (limited to 'src/nng.c')
-rw-r--r--src/nng.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nng.c b/src/nng.c
index d5c1b957..08606715 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -1215,6 +1215,21 @@ nng_socket_peer_name(nng_socket id, const char **name)
}
int
+nng_socket_raw(nng_socket id, bool *rawp)
+{
+ int rv;
+ nni_sock *sock;
+
+ if (((rv = nni_init()) != 0) ||
+ ((rv = nni_sock_find(&sock, id.id)) != 0)) {
+ return (rv);
+ }
+ *rawp = nni_sock_raw(sock);
+ nni_sock_rele(sock);
+ return (0);
+}
+
+int
nng_pipe_notify(nng_socket s, nng_pipe_ev ev, nng_pipe_cb cb, void *arg)
{
int rv;