aboutsummaryrefslogtreecommitdiff
path: root/docs/ref/migrate/nng1.md
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-11-02 23:16:22 -0700
committerGarrett D'Amore <garrett@damore.org>2024-11-02 23:16:22 -0700
commit8bac5ccdf1de7334311459b9e2666e74a2c16c15 (patch)
tree169ce8229a1a0eb6e810685a9923be1c2bf644a6 /docs/ref/migrate/nng1.md
parentd3622c0f6153ce0eccaad9c986d46b07cec91b5d (diff)
downloadnng-8bac5ccdf1de7334311459b9e2666e74a2c16c15.tar.gz
nng-8bac5ccdf1de7334311459b9e2666e74a2c16c15.tar.bz2
nng-8bac5ccdf1de7334311459b9e2666e74a2c16c15.zip
Replace `NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, and friends with functions.
Socket options were a little awkward, and these are core properties of the socket. Few if any applications need these. This also avoids some dynamic allocations.
Diffstat (limited to 'docs/ref/migrate/nng1.md')
-rw-r--r--docs/ref/migrate/nng1.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/migrate/nng1.md b/docs/ref/migrate/nng1.md
index 0e2c9a48..39968277 100644
--- a/docs/ref/migrate/nng1.md
+++ b/docs/ref/migrate/nng1.md
@@ -69,6 +69,15 @@ options must be set on the endpoint (dialer or listener) using the appropriate
to allocate and configure the endpoint before attaching it to the socket. This will
also afford a much more fine-grained level of control over transport options.
+## Socket Options
+
+The `NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, `NNG_OPT_PEER`, and `NNG_OPT_PEERNAME` options
+have been replaced by functions instead of options.
+Use `nng_socket_proto_id`, `nng_socket_peer_id`, `nng_socket_proto_name`, and `nng_socket_peer_name` instead.
+Note that the new functions provide a reference to a static string, and thus do not require
+allocation, and the returned strings should not be freed. Also the IDs are provided as `uint16_t`,
+matching the actual wire protocol values, instead of `int`.
+
## Statistics Use Constified Pointers
A number of the statistics functions take, or return, `const nng_stat *` instead