aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-10-26 10:02:33 -0700
committerGarrett D'Amore <garrett@damore.org>2025-10-26 10:02:33 -0700
commit72b96ad6925634e1b4efa775ffbed436b0a29abd (patch)
treeaca1508cbc9fa89597fae7e059263725983d6485 /include
parente0cb4377cc4d6fe50514e0b297e174fdde001bb6 (diff)
downloadnng-72b96ad6925634e1b4efa775ffbed436b0a29abd.tar.gz
nng-72b96ad6925634e1b4efa775ffbed436b0a29abd.tar.bz2
nng-72b96ad6925634e1b4efa775ffbed436b0a29abd.zip
NNG_OPT_BOUND_PORT replaces NNG_OPT_TCP/UDP_BOUND_PORT.
This is easier and agnostic about the underlying L3 protocol. We plan to remove direct NNG_OPT_LOCADDR support from listeners (and probably both NNG_OPT_LOCADDR and NNG_OPT_REMADDR have numbered days left in their lifetime. They will be replaced with more direct typed access functions as has been done for pipes already.) While here fixed some include for IWYU in the POSIX platform.
Diffstat (limited to 'include')
-rw-r--r--include/nng/nng.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h
index e5e0e02b..8e5dcd9f 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -833,19 +833,16 @@ NNG_DECL nng_listener nng_pipe_listener(nng_pipe);
// state current). This is a boolean.
#define NNG_OPT_TCP_KEEPALIVE "tcp-keepalive"
-// Local TCP port number. This is used on a listener, and is intended
+// Local TCP or UDP port number. This is used on a listener, and is intended
// to be used after starting the listener in combination with a wildcard
// (0) local port. This determines the actual ephemeral port that was
-// selected and bound. The value is provided as an int, but only the
-// low order 16 bits will be set. This is provided in native byte order,
+// selected and bound. The value is provided as an int, but in practice
+// port numbers are only 16-bits. This is provided in native byte order,
// which makes it more convenient than using the NNG_OPT_LOCADDR option.
-#define NNG_OPT_TCP_BOUND_PORT "tcp-bound-port"
+#define NNG_OPT_BOUND_PORT "bound-port"
// UDP options.
-// UDP alias for convenience uses the same value
-#define NNG_OPT_UDP_BOUND_PORT NNG_OPT_TCP_BOUND_PORT
-
// UDP short message size. Messages smaller than (or equal to) this
// will be copied, instead of loan up. This can allow for a faster
// pass up as we can allocate smaller message buffers instead of having