diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-01-05 16:30:02 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-01-06 12:12:27 -0800 |
| commit | 6d0027fae75e4810d66eb4c5817255ffa517e158 (patch) | |
| tree | 9bd36c16cf293e4335ab0650e226a335029012ad /include | |
| parent | 68c6310ee83078d6ad6af0c9ccddef11b8f8b7c2 (diff) | |
| download | nng-6d0027fae75e4810d66eb4c5817255ffa517e158.tar.gz nng-6d0027fae75e4810d66eb4c5817255ffa517e158.tar.bz2 nng-6d0027fae75e4810d66eb4c5817255ffa517e158.zip | |
fixes #839 TCP listener_start API should use constant sockaddr
Diffstat (limited to 'include')
| -rw-r--r-- | include/nng/supplemental/tcp/tcp.h | 9 | ||||
| -rw-r--r-- | include/nng/supplemental/tls/tls.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/include/nng/supplemental/tcp/tcp.h b/include/nng/supplemental/tcp/tcp.h index 447bc6f8..295006c7 100644 --- a/include/nng/supplemental/tcp/tcp.h +++ b/include/nng/supplemental/tcp/tcp.h @@ -125,11 +125,10 @@ NNG_DECL void nng_tcp_listener_free(nng_tcp_listener *); // the TCP port / address to be allocated. It does not accept any new // incoming connections. (The listenq depth is configured to some reasonable // default -- typically around 128.) This operation is synchronous. -// On success, the sockaddr will be update with the actual address bound. -// This is useful if the TCP port number 0 is specified, which permits -// the implementation to choose a free random port. The caller can then -// inspect the sockaddr to learn the actual bound port. -NNG_DECL int nng_tcp_listener_listen(nng_tcp_listener *, nng_sockaddr *); +// A zero valued port may be supplied in the sockaddr, in which case +// a follow up call to get the NNG_OPT_LOCADDR can be used to determine the +// bound address. +NNG_DECL int nng_tcp_listener_listen(nng_tcp_listener *, const nng_sockaddr *); // nng_tcp_listener_accept accepts an incoming connection (creating an // nng_tcp * object), and returns it in the nng_aio as the first output diff --git a/include/nng/supplemental/tls/tls.h b/include/nng/supplemental/tls/tls.h index ee80b45b..496f02e2 100644 --- a/include/nng/supplemental/tls/tls.h +++ b/include/nng/supplemental/tls/tls.h @@ -164,7 +164,7 @@ NNG_DECL int nng_tls_dialer_setopt( NNG_DECL int nng_tls_listener_alloc(nng_tls_listener **); NNG_DECL void nng_tls_listener_close(nng_tls_listener *); NNG_DECL void nng_tls_listener_free(nng_tls_listener *); -NNG_DECL int nng_tls_listener_listen(nng_tls_listener *, nng_sockaddr *); +NNG_DECL int nng_tls_listener_listen(nng_tls_listener *, const nng_sockaddr *); NNG_DECL void nng_tls_listener_accept(nng_tls_listener *, nng_aio *); NNG_DECL int nng_tls_listener_getopt( |
