diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/api/stream.md | 16 | ||||
| -rw-r--r-- | docs/ref/xref.md | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/docs/ref/api/stream.md b/docs/ref/api/stream.md index 38c6adb8..6b02d8db 100644 --- a/docs/ref/api/stream.md +++ b/docs/ref/api/stream.md @@ -76,6 +76,18 @@ stream itself. > or be aborted, these functions are unsafe to call from functions that may not block, such as the > completion function registered with an [`nng_aio`] when it is created. +## Stream Addresses + +```c +nng_err nng_stream_peer_addr(nng_stream *s, const nng_sockaddr **valp); +nng_err nng_stream_self_addr(nng_stream *s, const nng_sockaddr **valp); +``` + +{{hi:`nng_stream_peer_addr`}} +{{hi:`nng_stream_self_addr`}} +These functions are used to obtain value of the local (self) or remote (peer) addresses +for the given stream _s_. + ## Getting Stream Options ```c @@ -102,6 +114,10 @@ are available, and which type they may be accessed using. In the case of `nng_stream_get_string`, the string pointer is only guaranteed to be valid while the stream exists. Callers should make a copy of the data if required before closing the stream. +> [!NOTE]: +> The `nng_stream_get_addr` function is deprecated and will be removed. Use the +> [`nng_stream_peer_addr`] or [`nng_stream_self_addr`] functions instead. + ## Stream Factories ```c diff --git a/docs/ref/xref.md b/docs/ref/xref.md index 8ac6e2f5..d64840cb 100644 --- a/docs/ref/xref.md +++ b/docs/ref/xref.md @@ -170,6 +170,8 @@ [`nng_stream_listener_set_size`]: ../api/stream.md#stream-factory-options [`nng_stream_listener_set_addr`]: ../api/stream.md#stream-factory-options [`nng_stream_listener_set_string`]: ../api/stream.md#stream-factory-options +[`nng_stream_peer_addr`]: ../api/stream.md#stream-addresses +[`nng_stream_self_addr`]: ../api/stream.md#stream-addresses [`nng_init`]: ../api/init.md#initialization [`nng_fini`]: ../api/init.md#finalization [`nng_sub0_ctx_subscribe`]: ../proto/sub.md#context-operations |
