diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-02-16 12:40:41 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-02-16 19:22:27 -0800 |
| commit | 60231f0600461a9593a8f876518874866df3387a (patch) | |
| tree | 1a91f0b65b1ad2d5b995a3db21639f4bf7032066 /include | |
| parent | 5cf750697624d4fd63cfe26921209d7c30e1a2d2 (diff) | |
| download | nng-60231f0600461a9593a8f876518874866df3387a.tar.gz nng-60231f0600461a9593a8f876518874866df3387a.tar.bz2 nng-60231f0600461a9593a8f876518874866df3387a.zip | |
fixes #879 Desire NNG_OPT_TCP_BOUND_PORT
We also have made some support changes, including new APIs for printing
URLs, and some improvements to the NNG_OPT_URL to make use of this new
property.
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/nng.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/nng/nng.h b/include/nng/nng.h index eb50599a..4c29e476 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -754,6 +754,14 @@ enum nng_flag_enum { // 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 +// 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 provied as an int, but only the +// low order 16 bits will be set. This is provided in native byte order, +// which makes it more convienent than using the NNG_OPT_LOCADDR option. +#define NNG_OPT_TCP_BOUND_PORT "tcp-bound-port" + // IPC options. These will largely vary depending on the platform, // as POSIX systems have very different options than Windows. @@ -1115,7 +1123,8 @@ NNG_DECL int nng_stream_listener_get_addr( nng_stream_listener *, const char *, nng_sockaddr *); NNG_DECL int nng_stream_listener_set_bool( nng_stream_listener *, const char *, bool); -NNG_DECL int nng_stream_listener_set_int(nng_stream_listener *, const char *, int); +NNG_DECL int nng_stream_listener_set_int( + nng_stream_listener *, const char *, int); NNG_DECL int nng_stream_listener_set_ms( nng_stream_listener *, const char *, nng_duration); NNG_DECL int nng_stream_listener_set_size( |
