aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-21 22:48:32 -0800
committerGarrett D'Amore <garrett@damore.org>2024-11-21 22:48:32 -0800
commit925ac884f8bce34ad27fe18e851ebcecfe311356 (patch)
treef5ef6ed18876688a695af49a89df12114505f65f /include
parent7ea8abadec355eb7ea9f71fc2e2bdd73c1c77c62 (diff)
downloadnng-925ac884f8bce34ad27fe18e851ebcecfe311356.tar.gz
nng-925ac884f8bce34ad27fe18e851ebcecfe311356.tar.bz2
nng-925ac884f8bce34ad27fe18e851ebcecfe311356.zip
Collect the bound port as part of the URL at bind time.
This is a step on cleaning up our logic around NNG_OPT_URL.
Diffstat (limited to 'include')
-rw-r--r--include/nng/nng.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h
index f6b0a179..49b5da05 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -270,6 +270,11 @@ NNG_DECL int nng_socket_raw(nng_socket id, bool *rawp);
NNG_DECL const char *nng_str_sockaddr(
const nng_sockaddr *sa, char *buf, size_t bufsz);
+// Obtain a port number (for NNG_AF_INET and NNG_AF_INET6this will be 16 bits
+// maximum, but other address familiies may have larger port numbers.) For
+// address that don't have the concept of port numbers, zero will be returned.
+uint32_t nng_sockaddr_port(const nng_sockaddr *sa);
+
// Arguably the pipe callback functions could be handled as an option,
// but with the need to specify an argument, we find it best to unify
// this as a separate function to pass in the argument and the callback.