diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-01 23:53:54 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-01 23:54:07 -0800 |
| commit | c0b1557c7931b63435f9d340f5a290556a3cc59c (patch) | |
| tree | dfca6e97f013853fe3831c7f50e38fa3a4a95af2 | |
| parent | 61c886e86de03f89e0c6c1769171576482bf4245 (diff) | |
| download | nng-c0b1557c7931b63435f9d340f5a290556a3cc59c.tar.gz nng-c0b1557c7931b63435f9d340f5a290556a3cc59c.tar.bz2 nng-c0b1557c7931b63435f9d340f5a290556a3cc59c.zip | |
api: remove unused _uint64 options accessors for contexts and sockets
Also, clarification and add socket option docs for MAXRECVSZ, RECONNMINT, RECONNMAXT
| -rw-r--r-- | docs/ref/api/ctx.md | 4 | ||||
| -rw-r--r-- | docs/ref/api/sock.md | 13 | ||||
| -rw-r--r-- | docs/ref/migrate/nng1.md | 4 | ||||
| -rw-r--r-- | include/nng/nng.h | 4 | ||||
| -rw-r--r-- | src/nng.c | 24 |
5 files changed, 15 insertions, 34 deletions
diff --git a/docs/ref/api/ctx.md b/docs/ref/api/ctx.md index 43d79621..f1157def 100644 --- a/docs/ref/api/ctx.md +++ b/docs/ref/api/ctx.md @@ -171,13 +171,11 @@ int nng_ctx_get_bool(nng_ctx ctx, const char *opt, bool *valp); int nng_ctx_get_int(nng_ctx ctx, const char *opt, int *valp); int nng_ctx_get_ms(nng_ctx ctx, const char *opt, nng_duration *valp); int nng_ctx_get_size(nng_ctx ctx, const char *opt, size_t *valp); -int nng_ctx_get_uint64(nng_ctx ctx, const char *opt, uint64_t *valp); int nng_ctx_set_bool(nng_ctx ctx, const char *opt, int val); int nng_ctx_set_int(nng_ctx ctx, const char *opt, int val); int nng_ctx_set_ms(nng_ctx ctx, const char *opt, nng_duration val); int nng_ctx_set_size(nng_ctx ctx, const char *opt, size_t val); -int nng_ctx_set_uint64(nng_ctx ctx, const char *opt, uint64_t val); ``` Some protocols support certain options that affect the behavior of a specific context. @@ -189,7 +187,7 @@ The `nng_ctx_get_` functions retrieve the value from _ctx_, and store it in the The `nng_ctx_set_` functions change the value for the _ctx_, taking it from _val_. These functions access an option as a specific type. The protocol documentation will have details about which options -are available for contexts, whether they can be read or written, and which type they may be accessed using. +are available for contexts, whether they can be read or written, and the appropriate type to use. ## Examples diff --git a/docs/ref/api/sock.md b/docs/ref/api/sock.md index 88242721..0fef92e0 100644 --- a/docs/ref/api/sock.md +++ b/docs/ref/api/sock.md @@ -278,13 +278,11 @@ int nng_socket_get_bool(nng_socket s, const char *opt, bool *valp); int nng_socket_get_int(nng_socket s, const char *opt, int *valp); int nng_socket_get_ms(nng_socket s, const char *opt, nng_duration *valp); int nng_socket_get_size(nng_socket s, const char *opt, size_t *valp); -int nng_socket_get_uint64(nng_socket s, const char *opt, uint64_t *valp); int nng_socket_set_bool(nng_socket s, const char *opt, int val); int nng_socket_set_int(nng_socket s, const char *opt, int val); int nng_socket_set_ms(nng_socket s, const char *opt, nng_duration val); int nng_socket_set_size(nng_socket s, const char *opt, size_t val); -int nng_socket_set_uint64(nng_socket s, const char *opt, uint64_t val); ``` Protocols usually have protocol specific behaviors that can be adjusted via options. @@ -306,12 +304,21 @@ The following options are available for many protocols, and always use the same | Option | Type | Description | | --------------------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `NNG_OPT_RECONNMAXT` | `nng_duration` | Maximum time [dialers][dialer] will delay before trying after failing to connect. | +| `NNG_OPT_RECONNMINT` | `nng_duration` | Minimum time [dialers][dialer] will delay before trying after failing to connect. | | `NNG_OPT_RECVBUF`<a name="NNG_OPT_RECVBUF"></a> | `int` | Maximum number of messages to buffer locally when receiving. | -| `NNG_OPT_SENDBUF`<a name="NNG_OPT_SENDBUF"></a> | `int` | Maximum number of messages to buffer when sending messages. | | `NNG_OPT_RECVMAXSZ`<a name="NNG_OPT_RECVMAXSZ"></a> | `size_t` | Maximum message size acceptable for receiving. Can be tuned independently on [dialers][dialer] and [listeners][listener]. | | `NNG_OPT_RECVTIMEO`<a name="NNG_OPT_RECVTIMEO"></a> | `nng_duration` | Default timeout (ms) for receiving messages. | +| `NNG_OPT_SENDBUF`<a name="NNG_OPT_SENDBUF"></a> | `int` | Maximum number of messages to buffer when sending messages. | | `NNG_OPT_SENDTIMEO`<a name="NNG_OPT_SENDTIMEO"></a> | `nng_duration` | Default timeout (ms) for sending messages. | + + +> [!NOTE] +> The `NNG_OPT_RECONNMAXT`, `NNG_OPT_RECONNMINT`, and `NNG_OPT_RECVMAXSZ` options are just the initial defaults that [dialers][dialer] +> (and for `NNG_OPT_RECVMAXSZ` also [listeners][listener]) +> will use. After the dialer or listener is created, changes to the socket's value will have no affect on that dialer or listener. + ## Polling Socket Events ```c diff --git a/docs/ref/migrate/nng1.md b/docs/ref/migrate/nng1.md index 8e418468..960e8626 100644 --- a/docs/ref/migrate/nng1.md +++ b/docs/ref/migrate/nng1.md @@ -145,6 +145,8 @@ and are thus removed: - `nng_ctx_get_string` - `nng_ctx_set_string` +- `nng_ctx_get_uint64` +- `nng_ctx_set_uint64` - `nng_dialer_get_ptr` - `nng_dialer_set_ptr` - `nng_listener_get_ptr` @@ -153,6 +155,8 @@ and are thus removed: - `nng_socket_set_ptr` - `nng_socket_get_string` - `nng_socket_set_string` +- `nng_socket_get_uint64` +- `nng_socket_set_uint64` - `nng_stream_get_ptr` - `nng_stream_set_ptr` - `nng_stream_dialer_get_ptr` diff --git a/include/nng/nng.h b/include/nng/nng.h index 664da2d5..00b7bd89 100644 --- a/include/nng/nng.h +++ b/include/nng/nng.h @@ -220,13 +220,11 @@ NNG_DECL int nng_socket_id(nng_socket); NNG_DECL int nng_socket_set_bool(nng_socket, const char *, bool); NNG_DECL int nng_socket_set_int(nng_socket, const char *, int); NNG_DECL int nng_socket_set_size(nng_socket, const char *, size_t); -NNG_DECL int nng_socket_set_uint64(nng_socket, const char *, uint64_t); NNG_DECL int nng_socket_set_ms(nng_socket, const char *, nng_duration); NNG_DECL int nng_socket_get_bool(nng_socket, const char *, bool *); NNG_DECL int nng_socket_get_int(nng_socket, const char *, int *); NNG_DECL int nng_socket_get_size(nng_socket, const char *, size_t *); -NNG_DECL int nng_socket_get_uint64(nng_socket, const char *, uint64_t *); NNG_DECL int nng_socket_get_ms(nng_socket, const char *, nng_duration *); // These functions are used to obtain a file descriptor that will poll @@ -465,14 +463,12 @@ NNG_DECL int nng_ctx_sendmsg(nng_ctx, nng_msg *, int); NNG_DECL int nng_ctx_get_bool(nng_ctx, const char *, bool *); NNG_DECL int nng_ctx_get_int(nng_ctx, const char *, int *); NNG_DECL int nng_ctx_get_size(nng_ctx, const char *, size_t *); -NNG_DECL int nng_ctx_get_uint64(nng_ctx, const char *, uint64_t *); NNG_DECL int nng_ctx_get_ms(nng_ctx, const char *, nng_duration *); NNG_DECL int nng_ctx_set(nng_ctx, const char *, const void *, size_t); NNG_DECL int nng_ctx_set_bool(nng_ctx, const char *, bool); NNG_DECL int nng_ctx_set_int(nng_ctx, const char *, int); NNG_DECL int nng_ctx_set_size(nng_ctx, const char *, size_t); -NNG_DECL int nng_ctx_set_uint64(nng_ctx, const char *, uint64_t); NNG_DECL int nng_ctx_set_ms(nng_ctx, const char *, nng_duration); // nng_alloc is used to allocate memory. It's intended purpose is for @@ -395,12 +395,6 @@ nng_ctx_get_size(nng_ctx id, const char *n, size_t *v) } int -nng_ctx_get_uint64(nng_ctx id, const char *n, uint64_t *v) -{ - return (ctx_get(id, n, v, NULL, NNI_TYPE_UINT64)); -} - -int nng_ctx_get_ms(nng_ctx id, const char *n, nng_duration *v) { return (ctx_get(id, n, v, NULL, NNI_TYPE_DURATION)); @@ -439,12 +433,6 @@ nng_ctx_set_size(nng_ctx id, const char *n, size_t v) } int -nng_ctx_set_uint64(nng_ctx id, const char *n, uint64_t v) -{ - return (ctx_set(id, n, &v, sizeof(v), NNI_TYPE_UINT64)); -} - -int nng_ctx_set_ms(nng_ctx id, const char *n, nng_duration v) { return (ctx_set(id, n, &v, sizeof(v), NNI_TYPE_DURATION)); @@ -1063,12 +1051,6 @@ nng_socket_set_size(nng_socket id, const char *n, size_t v) } int -nng_socket_set_uint64(nng_socket id, const char *n, uint64_t v) -{ - return (socket_set(id, n, &v, sizeof(v), NNI_TYPE_UINT64)); -} - -int nng_socket_set_ms(nng_socket id, const char *n, nng_duration v) { return (socket_set(id, n, &v, sizeof(v), NNI_TYPE_DURATION)); @@ -1107,12 +1089,6 @@ nng_socket_get_size(nng_socket id, const char *n, size_t *v) } int -nng_socket_get_uint64(nng_socket id, const char *n, uint64_t *v) -{ - return (socket_get(id, n, v, NULL, NNI_TYPE_UINT64)); -} - -int nng_socket_get_ms(nng_socket id, const char *n, nng_duration *v) { return (socket_get(id, n, v, NULL, NNI_TYPE_DURATION)); |
