diff --git a/man/tip/nng_aio_alloc.3.html b/man/tip/nng_aio_alloc.3.html
index 939dcab5..07fde231 100644
--- a/man/tip/nng_aio_alloc.3.html
+++ b/man/tip/nng_aio_alloc.3.html
@@ -550,7 +550,7 @@ It will be called with the argument arg.
The callback callb must not perform any blocking operations, and
-must complete it’s execution quickly. If callb does block, this can
+must complete its execution quickly. If callb does block, this can
lead ultimately to an apparent "hang" or deadlock in the application.
The nng_dialer() function creates a newly initialized
+
The nng_dial() function creates a newly initialized
nng_dialer object,
associated with socket s, and configured to listen at the
address specified by url, and starts it.
@@ -654,7 +654,7 @@ using nng_dialer_create() an
NNG_EINVAL
-
An invalid set of flags was specified.
+
An invalid set of flags or an invalid url was specified.
The nng_http_handler_collect_data() function causes the handler to
+collect any request body that was submitted with the request, and attach
+it to the nng_http_req before the handler is called.
+
+
+
Subsequently the data can be retrieved by the handler from the request with the
+nng_http_req_get_data() function.
+
+
+
The collection is enabled if want is true.
+Furthermore, the data that the client may sent is limited by the
+value of maxsz.
+If the client attempts to send more data than maxsz, then the
+request will be terminated with a 400 “Bad Request” status.
+
+
+
+
+
+
+
+
+Limiting the size of incoming request data can provide protection
+against denial of service attacks, as a buffer of the client-supplied
+size must be allocated to receive the data.
+
+
+
+
+
+
In order to provide an unlimited size, use (size_t)-1 for maxsz.
+The value 0 for maxsz can be used to prevent any data from being passed
+by the client.
+
+
+
The built-in handlers for files, directories, and static data limit the
+maxsz to zero by default.
+Otherwise the default setting is to enable this capability with a default
+value of maxsz of 1 megabyte.
+
+
+
+
+
+
+
+
+The handler looks for data indicated by the Content-Length: HTTP
+header.
+If this header is absent, the request is assumed not to contain any data.
+
+
+
+
+
+
+
+
+
+
+
+This specifically does not support the Chunked transfer-encoding.
+This is considered a bug, and is a deficiency for full HTTP/1.1 compliance.
+However, few clients send data in this format, so in practice this should
+not create few limitations.
+
+
+
+
+
+
+
+
RETURN VALUES
+
+
+
This function returns 0 on success, and non-zero otherwise.
+
+
diff --git a/man/tip/nng_http_req_alloc.3http.html b/man/tip/nng_http_req_alloc.3http.html
index dd402519..f12a1289 100644
--- a/man/tip/nng_http_req_alloc.3http.html
+++ b/man/tip/nng_http_req_alloc.3http.html
@@ -542,6 +542,20 @@ and stores a pointer to it in reqp.
The request will be initialized
to perform an HTTP/1.1 GET operation using the URL specified in url.
+
+
+
+
+
+
+
+It is possible to specify NULL for the URL.
+In this case the URI for the request must be specified by a subsequent call
+to nng_http_req_set_uri().
+
The nng_http_req_reset() function resets the request req so that it
+is just as if it had been freshly allocated with
+nng_http_req_alloc() with a NULL URL.
+
+
+
+
+
+
+
+
+Before using this with an HTTP operation, the URI must be set using
+nng_http_req_set_uri().
+
The nng_http_res_alloc() function allocates a new HTTP response structure
and stores a pointer to it in resp.
The response will be initialized
-with status code 200 (NNG_HTTP_STATUS_OK), and a reason phrase of "OK",
-and HTTP protocol version "HTTP/1.1".
+with status code 200 (NNG_HTTP_STATUS_OK), and a reason phrase of `"OK`",
+and HTTP protocol version `"HTTP/1.1`".
+
+
diff --git a/man/tip/nng_listen.3.html b/man/tip/nng_listen.3.html
index b377b2f8..2424b208 100644
--- a/man/tip/nng_listen.3.html
+++ b/man/tip/nng_listen.3.html
@@ -642,7 +642,7 @@ their pipes with the socket, until either it or the socket s is closed.
NNG_EINVAL
-
An invalid set of flags was specified.
+
An invalid set of flags or an invalid url was specified.
diff --git a/man/tip/nng_listener_setopt.3.html b/man/tip/nng_listener_setopt.3.html
index 8ad13282..9390c1ed 100644
--- a/man/tip/nng_listener_setopt.3.html
+++ b/man/tip/nng_listener_setopt.3.html
@@ -571,7 +571,7 @@ are documented with the transports and protocols themselves.
Once a listener has started, it is generally not possible to change
-it’s configuration.
+its configuration.
diff --git a/man/tip/nng_listener_start.3.html b/man/tip/nng_listener_start.3.html
index 37d8b8d5..4178d73e 100644
--- a/man/tip/nng_listener_start.3.html
+++ b/man/tip/nng_listener_start.3.html
@@ -546,7 +546,7 @@ Each new connection results in an nng_pipe
which will be attached to the listener’s socket.
-
Normally, the act of “binding” to it’s address is done
+
Normally, the act of “binding” to its address is done
synchronously, including any necessary name resolution.
As a result,
a failure, such as if the address is already in use, will be returned
@@ -570,7 +570,7 @@ it also generally makes diagnosing failures somewhat more difficult.
Once a listener has started, it is generally not possible to change
-it’s configuration.
The nng_msg_append() and nng_msg_append_u32() functions append data to
+
The nng_msg_append() family of functions appends data to
the end of the body of message msg, reallocating it if necessary.
-The first function appends size bytes, copying them from val. The
-second function appends the value val32 in network-byte order (big-endian).
+The first function appends size bytes, copying them from val.
+The remaining functions append the value specified (such as val32) in
+network-byte order (big-endian).
@@ -549,7 +551,7 @@ second function appends the value val32 in network-byte order (big-endi
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These functions return 0 on success, and non-zero otherwise.
The nng_msg_chop() and nng_msg_chop_u32() functions remove data from
+
The nng_msg_chop() family of functions removes data from
the end of the body of message msg.
The first function removes size bytes.
-The second function removes 4 bytes, and stores them in the value val32,
+The remaining functions remove 2, 4, or 8 bytes, and stores them in the value
+(such as val32),
after converting them from network-byte order (big-endian) to native byte order.
@@ -550,7 +552,7 @@ after converting them from network-byte order (big-endian) to native byte order.
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These functions return 0 on success, and non-zero otherwise.
The nng_msg_header_append() and nng_msg_header_append_u32()
-functions append data to
+
The nng_msg_header_append() family of functions appends data to
the end of the headers of message msg, reallocating it if necessary.
-The first function appends size bytes, copying them from val.
-The second function appends the value val32 in network-byte order
-(big-endian).
+The first function appends size bytes, copying them from val.
+
+
+
The remaining functions append the value (such as val32) in
+network-byte order (big-endian).
@@ -551,7 +553,7 @@ The second function appends the value val32 in network-byte order
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These functions return 0 on success, and non-zero otherwise.
The nng_msg_header_chop() and nng_msg_header_chop_u32() functions remove
+
The nng_msg_header_chop() family of functions removes
data from the end of the header of message msg.
The first function removes size bytes.
-The second function removes 4 bytes, and stores them in the value val32,
+The remaining functions remove 2, 4, or 8 bytes, and stores them in the value
+(such as val32),
after converting them from network-byte order (big-endian) to native
byte order.
@@ -551,7 +553,7 @@ byte order.
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These function return 0 on success, and non-zero otherwise.
The nng_msg_header_insert() and nng_msg_header_insert_u32() functions
-prepend data to the front of the headers of message msg, reallocating
+
The nng_msg_header_insert() family of functions
+prepends data to the front of the headers of message msg, reallocating
if necessary.
-The first function prepends size bytes, copying them from val. The
-second function prepends the value val32 in network-byte order (big-endian).
+The first function prepends size bytes, copying them from val.
+The remaining functions prepend the specified value (such as val32) in
+network-byte order (big-endian).
@@ -550,7 +552,7 @@ second function prepends the value val32 in network-byte order (big-end
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These functions return 0 on success, and non-zero otherwise.
The nng_msg_header_trim() and nng_msg_header_trim_u32() functions remove
+
The nng_msg_header_trim() family of functions remove
data from the start of the header of message msg.
The first function removes size bytes.
-The second function removes 4 bytes, and stores them in the value val32,
+The remaining functions removes 2, 4, or 8 bytes, and stores them in the
+value (such as val32),
after converting them from network-byte order (big-endian) to native
byte order.
The nng_msg_insert() and nng_msg_insert_u32() functions prepend data to
+
The nng_msg_insert() family of functions prepends data to
the front of the body of message msg, reallocating it if necessary.
The first function prepends size bytes, copying them from val.
-The second function prepends the value val32 in network-byte order
-(big-endian).
+The remaining functions prepend the specified value (such as val32)
+in network-byte order (big-endian).
@@ -551,7 +552,7 @@ The second function prepends the value val32 in network-byte order
-This function makes use of pre-allocated “headroom” in the message if
+These functions make use of pre-allocated “headroom” in the message if
available, so it can often avoid performing any reallocation.
Applications should use this instead of reallocating and copying message
content themselves, in order to benefit from this capability.
@@ -565,7 +566,7 @@ content themselves, in order to benefit from this capability.
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These functions return 0 on success, and non-zero otherwise.
The nng_msg_trim() and nng_msg_trim_u32() functions remove data from
+
The nng_msg_trim() family of functions removes data from
the start of the body of message msg.
The first function removes size bytes.
-The second function removes 4 bytes, and stores them in the value val32,
+The remaining functions remove 2, 4, or 8 bytes, and stores them in the value
+(such as val32),
after converting them from network-byte order (big-endian) to native
byte order.
@@ -551,7 +553,7 @@ byte order.
RETURN VALUES
-
This function returns 0 on success, and non-zero otherwise.
+
These functions return 0 on success, and non-zero otherwise.
diff --git a/man/tip/nng_options.5.html b/man/tip/nng_options.5.html
index 08de92f3..75016132 100644
--- a/man/tip/nng_options.5.html
+++ b/man/tip/nng_options.5.html
@@ -920,7 +920,7 @@ Those that do generally have a default value of 8.
-Each node along a forwarding path may have it’s own value for the
+Each node along a forwarding path may have its own value for the
maximum time-to-live, and performs its own checks before forwarding a message.
Therefore it is helpful if all nodes in the topology use the same value for
this option.
diff --git a/man/tip/nng_opts_parse.3supp.html b/man/tip/nng_opts_parse.3supp.html
index 7b29437c..bc3e26b4 100644
--- a/man/tip/nng_opts_parse.3supp.html
+++ b/man/tip/nng_opts_parse.3supp.html
@@ -543,7 +543,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
boolo_arg;// Option takes an argument if true}nng_optspec;
-intnng_opts_parse(intargc,constchar**argv,constnng_optspec*spec,int*val,constchar**arg,int*idx);
+intnng_opts_parse(intargc,char*const*argv,constnng_optspec*spec,int*val,char**arg,int*idx);
diff --git a/man/tip/nng_sockaddr.5.html b/man/tip/nng_sockaddr.5.html
index d5e069a9..9ce09af3 100644
--- a/man/tip/nng_sockaddr.5.html
+++ b/man/tip/nng_sockaddr.5.html
@@ -558,7 +558,7 @@ addresses, IPC paths, and so forth.
-
The name sockaddr is based on it’s similarity with POSIX struct sockaddr,
+
The name sockaddr is based on its similarity with POSIX struct sockaddr,
but in the nng library, these addresses are more closely affiliated with
instances of nng_pipe
than of nng_socket.
diff --git a/man/tip/nng_stat.5.html b/man/tip/nng_stat.5.html
new file mode 100644
index 00000000..102bd09e
--- /dev/null
+++ b/man/tip/nng_stat.5.html
@@ -0,0 +1,622 @@
+---
+version: tip
+layout: refman
+---
+
+
+
Most statistics are numeric,
+and thus carry a value (nng_stat_value())
+and frequently also a unit that the value measures (nng_stat_unit()).
+
+
+
Some statistics however, are simply strings (nng_stat_string()),
+and thus carry no numeric value.
+
+
+
Statistics are organized as a tree, and any given statistic can have siblings
+(nng_stat_next()).
+Note however that generally only NNG_STAT_SCOPE statistics, which are
+act as placeholders in the tree (and carry no value),
+will have children (nng_stat_child()).
+
+
+
A tree of statistics is collected using nng_stats_get(),
+and can be freed when no longer needed with nng_stats_free().
+This collection process is generally performed in a way to minimize impact
+to running operations, but there is still some impact caused by collection
+of statistics.
+
+
+
The time when a statistic’s value is captured can be obtained using
+nng_stat_timestap(), which is useful for
+measuring rates of change in certain statistics.
+
+
+
+
+
+
+
+
+The presence, names, and meanings of any given statistic are
+subject to change at any time. These statistics are provided as an aid
+for debugging, and should generally not be relied upon for programmatic
+behaviors.
+
+
+
+
+
+
+
+
+
+
+
+Statistics may be disabled by build-time configuration options,
+in order to reduce program size and run-time overheads.
+
The nng_stat_timestamp() function returns the a timestamp, which is measured
+as a number of milliseconds since some arbitrary value in the past.
+
+
+
Even within the same snapshot, statistics might have different timestamp
+values, as the timestamp represents the time when that particular statistic
+was captured.
+
+
+
+
+
+
+
+
+These values are intended to facilitate calculation of rates, by
+comparing values from one snapshot with a subsequent one.
+
+
+
+
+
+
+
+
+
+
+
+The values used here have the same offset as the
+nng_clock() supplementation function.
+This can be useful when converting these values to local clock time.
+
+
+
+
+
+
+
+
RETURN VALUES
+
+
+
The timestamp when stat was captured, measured as a number of
+milliseconds since some time in the past.
The nng_stat_type() function returns the type of the statistic stat.
+
+
+
The returned type will be one of the following values:
+
+
+
+
NNG_STAT_SCOPE
+
+
This is a placeholder providing scope, and carries no value on its own.
+Instead it is a parent node with child statistics (see
+nng_stat_child().)
+
+
NNG_STAT_LEVEL
+
+
This is a numeric statistic, but its value is a level, so rate calculations
+based on changes in this value should not be considered significant.
+
+
NNG_STAT_COUNTER
+
+
This is a numeric statistic that represents an increasing count, typically
+of events, messages, or bytes.
+Frequently, it is interesting to consider changes in this statistic divided
+by time to obtain a rate.
+(For example, throughput might be calculated as changes in a byte counter
+divided by the interval over which the change occurred.)
+
+
NNG_STAT_STRING
+
+
This is a string, and carries no numeric value.
+Instead the nng_stat_string(3) function
+should be used to obtain the value.
+
+
NNG_STAT_BOOLEAN
+
+
This is a boolean value.
+The nng_stat_value() function will return zero
+to represent a false value, and one to represent a true value.
+
+
+
+
+
NNG_STAT_ID:
+The statistic is a numeric ID.
+These are generally immutable values that represent an identity that might
+be used with another interface.
+
+
+
+
+
+
+
+
+For NNG_STAT_COUNTER and NNG_STAT_LEVEL statistics, the
+nng_stat_unit() function will provide more
+detail about the units measured by the static.
+
The nng_stat_unit() function returns the unit of quantity measured
+by the statistic stat.
+
+
+
The returned value will be one of the following values:
+
+
+
+
NNG_UNIT_NONE
+
+
There are no particular units measured.
+In some cases there may be units, but the type of the unit will be obvious
+from the name (see nng_stat_name()) of the statistic.
+
+
NNG_UNIT_BYTES
+
+
The statistic is a count of bytes.
+
+
NNG_UNIT_MESSAGES
+
+
The statistic is a count of messages.
+Typically, one message corresponds to a single nng_msg structure.
+
+
NNG_UNIT_MILLIS
+
+
The statistic is a count of milliseconds.
+
+
NNG_STAT_EVENTS
+
+
The statistic is a count of some other type of event.
+
+
+
+
+
For statistics that are neither NNG_STAT_COUNTER nor NNG_STAT_LEVEL
+type (see nng_stat_type()), the unit will
+generally be NNG_UNIT_NONE.
+
+
+
+
+
+
+
+
+Normally rates can be calculated for NNG_STAT_COUNTER values for
+any of these units, but for NNG_UNIT_MILLIS rate calculations are generally
+meaningless.
+
The nng_stat_value() function returns a numeric value for the statistic stat.
+If the statistic has a boolean value, then zero is returned for false, and
+one is returned for true.
+Otherwise, if the string is not of numeric type, then zero is returned.
+See nng_stat_type(3) for a description of statistic types.
+
+
+
+
+
RETURN VALUES
+
+
+
The numeric or boolean value associated with stat.
The nng_stats_free() function deallocates a statistics snapshot
+previously collected with
+nng_stats_get().
+After calling this, all values associated with the snapshot are
+invalidated.
+
+
+
+
+
+
+
+
+Only the top of the collected statistics tree can be
+freed using this function.
+
The nng_stat_get() function attempts to obtain a snapshot of all the
+various diagnostic statistics that are present in the system.
+
+
+
+
+
+
+
+
+The process of collecting statistics is designed to have minimal
+impact on the system, but there is still some impact.
+
+
+
+
+
+
The statistics are organized as a tree, rooted with a parent
+statistic of type NNG_STAT_SCOPE that carries no value, and which
+has an empty name.
+This parent statistic is returned through the statsp pointer.
When no longer needed, the statistics can be freed with the
+nng_stats_free() function, but that
+function must be called only with the root statistic that is returned
+through the statsp pointer.
+
+
+
+
+
+
+
+
+The values of individual statistics are guaranteed to be atomic,
+but due the way statistics are collected there can be discrepancies between them at certain times.
+For example, statistics counting bytes and messages received may not
+reflect the same number of messages, depending on when the snapshot is taken.
+This potential inconsistency arises as a result of optimizations to minimize
+the impact of statistics on actual operations.
+
+
+
+
+
+
+
+
+
+
+
+The names, values, and semantics of statistics provided may change
+from release to release.
+These are provided for informational and debugging use only, and applications
+should not rely on the presence, names, or meanings of any individual statistics.
+
+
+
+
+
+
+
+
RETURN VALUES
+
+
+
This function returns a pointer to the allocated memory on success,
+and NULL otherwise.
+
+
+
+
+
ERRORS
+
+
+
+
+
+NNG_ENOMEM
+
+
+
Insufficient free memory to collect statistics.
+
+
+
+
+NNG_ENOTSUP
+
+
+
Statistics are not supported (compile time option).
+
+
diff --git a/man/tip/nng_tls_config_cert_key_file.3tls.html b/man/tip/nng_tls_config_cert_key_file.3tls.html
index 2f8c9640..678e7ceb 100644
--- a/man/tip/nng_tls_config_cert_key_file.3tls.html
+++ b/man/tip/nng_tls_config_cert_key_file.3tls.html
@@ -548,7 +548,7 @@ establishing TLS sessions using cfg.
It may contain additional certificates leading to a validation chain,
with the leaf certificate first.
There is no need to include the self-signed root, as the peer
-will need to have that already in order to perform it’s own validation.
+will need to have that already in order to perform its own validation.
The private key may be encrypted with a password, in which can be supplied in
diff --git a/man/tip/nng_zerotier.7.html b/man/tip/nng_zerotier.7.html
index 0a8dda54..4ea2c78c 100644
--- a/man/tip/nng_zerotier.7.html
+++ b/man/tip/nng_zerotier.7.html
@@ -806,7 +806,7 @@ The default is 500 msec.
The maximum number (int) of attempts to try to establish a connection
before reporting a timeout, and is only used with dialers.
The default is 240, which results in a 2 minute timeout if
-NNG_OPT_ZT_CONN_TIME is at it’s default of 500.
+NNG_OPT_ZT_CONN_TIME is at its default of 500.
If the value is set to 0, then connection attempts will keep retrying forever.
@@ -849,7 +849,7 @@ protocol may consume additional space, typically not more than 16-bytes.)
NNG_OPT_ZT_ORBIT:
This is a write-only option that takes an array of two uint64_t values,
indicating the ID of a ZeroTier “moon”, and the node ID of the root server
- for that moon. (The ID may be zero if the moon ID is the same as it’s
+ for that moon. (The ID may be zero if the moon ID is the same as its
root server ID, which is conventional.)