summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-09 08:32:33 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-11 10:31:44 -0800
commitdb5467e6c3b502f6e93a6f6c5d1f2a8f86a8eaa5 (patch)
tree71fb23ed0f0e2eb980245fcdf72cf2fce5d152be /src/core/socket.c
parent768eaa4d50a6a436b714188ec9c6b98fd729b306 (diff)
downloadnng-db5467e6c3b502f6e93a6f6c5d1f2a8f86a8eaa5.tar.gz
nng-db5467e6c3b502f6e93a6f6c5d1f2a8f86a8eaa5.tar.bz2
nng-db5467e6c3b502f6e93a6f6c5d1f2a8f86a8eaa5.zip
Add new functions for socket identity.
These functions were added in the main branch for NNG 2.0, and we add them here to facilitate converting any code that happened to use the options (`NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, `NNG_OPT_PEER`, `NNG_OPT_PEERNAME`, and `NNG_OPT_RAW`. Its unlikely that many applications need this, but providing these as a transition aid may help applications start adopting new APIs now.
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index c4e16f70..bf550a24 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -877,6 +877,12 @@ nni_sock_peer_name(nni_sock *sock)
return (sock->s_peer_id.p_name);
}
+bool
+nni_sock_raw(nni_sock *sock)
+{
+ return ((nni_sock_flags(sock) & NNI_PROTO_FLAG_RAW) != 0);
+}
+
struct nni_proto_pipe_ops *
nni_sock_proto_pipe_ops(nni_sock *sock)
{