summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-03-25 21:11:43 -0700
committerGarrett D'Amore <garrett@damore.org>2024-03-25 21:11:43 -0700
commit9d71bbc9f67478ccc28bf6ea9cb1617e8293be94 (patch)
tree5f8da683d30f024b705df82754be3a17c6ad6327 /docs
parent331bd5a7c360083f245fe6c82afa38dd05c4a9c9 (diff)
downloadnng-9d71bbc9f67478ccc28bf6ea9cb1617e8293be94.tar.gz
nng-9d71bbc9f67478ccc28bf6ea9cb1617e8293be94.tar.bz2
nng-9d71bbc9f67478ccc28bf6ea9cb1617e8293be94.zip
More updates
Diffstat (limited to 'docs')
-rw-r--r--docs/man/nng_aio.5.adoc70
-rw-r--r--docs/man/nng_clock.3supp.adoc59
-rw-r--r--docs/man/nng_close.3.adoc59
-rw-r--r--docs/man/nng_compat.3compat.adoc214
-rw-r--r--docs/man/nng_ctx.5.adoc176
-rw-r--r--docs/man/nng_cv_alloc.3supp.adoc60
-rw-r--r--docs/man/nng_cv_free.3supp.adoc42
-rw-r--r--docs/man/nng_cv_until.3supp.adoc91
-rw-r--r--docs/man/nng_cv_wait.3supp.adoc86
-rw-r--r--docs/man/nng_cv_wake.3supp.adoc61
-rw-r--r--docs/man/nng_cv_wake1.3supp.adoc61
-rw-r--r--docs/reference/src/api/socket/index.md (renamed from docs/reference/src/api/protocol.md)0
-rw-r--r--docs/reference/src/api/socket/nng_bus_open.md (renamed from docs/reference/src/api/nng_bus_open.md)0
-rw-r--r--docs/reference/src/api/socket/nng_close.md (renamed from docs/reference/src/api/nng_close.md)0
-rw-r--r--docs/reference/src/api/socket/nng_pub_open.md (renamed from docs/man/nng_pub_open.3.adoc)0
-rw-r--r--docs/reference/src/api/threads/nng_cv_alloc.md (renamed from docs/reference/src/api/nng_cv_alloc.md)0
-rw-r--r--docs/reference/src/api/threads/nng_cv_free.md (renamed from docs/reference/src/api/nng_cv_free.md)0
-rw-r--r--docs/reference/src/api/threads/nng_cv_until.md (renamed from docs/reference/src/api/nng_cv_until.md)0
-rw-r--r--docs/reference/src/api/threads/nng_cv_wait.md (renamed from docs/reference/src/api/nng_cv_wait.md)0
-rw-r--r--docs/reference/src/api/threads/nng_cv_wake.md (renamed from docs/reference/src/api/nng_cv_wake.md)0
-rw-r--r--docs/reference/src/api/threads/nng_cv_wake1.md (renamed from docs/reference/src/api/nng_cv_wake1.md)0
-rw-r--r--docs/reference/src/api/util/nng_random.md (renamed from docs/man/nng_random.3supp.adoc)0
-rw-r--r--docs/reference/src/api/util/nng_strerror.md (renamed from docs/man/nng_strerror.3.adoc)0
23 files changed, 0 insertions, 979 deletions
diff --git a/docs/man/nng_aio.5.adoc b/docs/man/nng_aio.5.adoc
deleted file mode 100644
index d2b10324..00000000
--- a/docs/man/nng_aio.5.adoc
+++ /dev/null
@@ -1,70 +0,0 @@
-= nng_aio(5)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_aio - asynchronous I/O handle
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-
-typedef struct nng_aio nng_aio;
-----
-
-== DESCRIPTION
-
-An `nng_aio`(((aio))) is an opaque structure used in conjunction with
-((asynchronous I/O)) operations.
-Every asynchronous operation uses one of these structures, each of which
-can only be used with a single operation at a time.
-
-Asynchronous operations are performed without blocking calling application
-threads.
-Instead the application registers a callback function to be executed
-when the operation is complete (whether successfully or not).
-This callback will be executed exactly once.
-
-The asynchronous I/O framework also supports cancellation of
-operations that are already in progress
-(see xref:nng_aio_cancel.3.adoc[`nng_aio_cancel()`]), as well setting a maximum
-timeout for them to complete within
-(see xref:nng_aio_set_timeout.3.adoc[`nng_aio_set_timeout()`]).
-
-It is also possible to initiate an asynchronous operation, and wait for it to
-complete using xref:nng_aio_wait.3.adoc[`nng_aio_wait()`].
-
-These structures are created using the xref:nng_aio_alloc.3.adoc[`nng_aio_alloc()`],
-and destroyed using xref:nng_aio_free.3.adoc[`nng_aio_free()`].
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_aio_abort.3.adoc[nng_aio_abort(3)],
-xref:nng_aio_alloc.3.adoc[nng_aio_alloc(3)],
-xref:nng_aio_cancel.3.adoc[nng_aio_cancel(3)],
-xref:nng_aio_count.3.adoc[nng_aio_count(3)],
-xref:nng_aio_free.3.adoc[nng_aio_free(3)],
-xref:nng_aio_get_input.3.adoc[nng_aio_get_input(3)],
-xref:nng_aio_get_msg.3.adoc[nng_aio_get_msg(3)],
-xref:nng_aio_get_output.3.adoc[nng_aio_get_output(3)],
-xref:nng_aio_result.3.adoc[nng_aio_result(3)],
-xref:nng_aio_set_input.3.adoc[nng_aio_set_input(3)],
-xref:nng_aio_set_iov.3.adoc[nng_aio_set_iov(3)],
-xref:nng_aio_set_msg.3.adoc[nng_aio_set_msg(3)],
-xref:nng_aio_set_timeout.3.adoc[nng_aio_set_timeout(3)],
-xref:nng_aio_stop.3.adoc[nng_aio_stop(3)],
-xref:nng_aio_wait.3.adoc[nng_aio_wait(3)],
-xref:nng_strerror.3.adoc[nng_strerror(3)],
-xref:nng_aio.5.adoc[nng_aio(5)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_clock.3supp.adoc b/docs/man/nng_clock.3supp.adoc
deleted file mode 100644
index d413f1b2..00000000
--- a/docs/man/nng_clock.3supp.adoc
+++ /dev/null
@@ -1,59 +0,0 @@
-= nng_clock(3supp)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_clock - get time
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-typedef uint64_t nng_time;
-
-nng_time nng_clock(void);
-----
-
-== DESCRIPTION
-
-The `nng_clock()` returns the number of elapsed milliseconds since some
-arbitrary time in the past.
-The resolution of the clock depends on the underlying timing facilities
-of the system.
-This function may be used for timing, but applications should not expect
-very fine-grained values.
-
-IMPORTANT: The reference time will be the same for a given program,
-but different programs may have different references.
-
-TIP: This function is intended mostly to help with setting appropriate
-timeouts using xref:nng_cv_until.3supp.adoc[`nng_cv_until()`].
-
-== RETURN VALUES
-
-Milliseconds since reference time.
-
-== ERRORS
-
-None.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_sleep_aio.3.adoc[nng_sleep_aio(3)],
-xref:nng_strerror.3.adoc[nng_strerror(3)],
-xref:nng_cv_until.3supp.adoc[nng_cv_until(3supp)],
-xref:nng_msleep.3supp.adoc[nng_msleep(3supp)],
-xref:nng_duration.5.adoc[nng_duration(5)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_close.3.adoc b/docs/man/nng_close.3.adoc
deleted file mode 100644
index 1867df07..00000000
--- a/docs/man/nng_close.3.adoc
+++ /dev/null
@@ -1,59 +0,0 @@
-= nng_close(3)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_close - close socket
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-
-int nng_close(nng_socket s);
-----
-
-== DESCRIPTION
-
-The `nng_close()` function closes the supplied socket, _s_.
-Messages that have been submitted for sending may be flushed or delivered,
-depending upon the transport.
-
-Further attempts to use the socket after this call returns will result
-in `NNG_ECLOSED`.
-Threads waiting for operations on the socket when this
-call is executed may also return with an `NNG_ECLOSED` result.
-
-NOTE: Closing the socket while data is in transmission will likely lead to loss
-of that data.
-There is no automatic linger or flush to ensure that the socket send buffers
-have completely transmitted.
-It is recommended to wait a brief period after calling
-xref:nng_send.3.adoc[`nng_send()`] or similar functions, before calling this
-function.
-
-== RETURN VALUES
-
-This function returns 0 on success, and non-zero otherwise.
-
-== ERRORS
-
-[horizontal]
-`NNG_ECLOSED`:: The socket _s_ is already closed or was never opened.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_strerror.3.adoc[nng_strerror(3)],
-xref:nng_options.5.adoc[nng_options(5)],
-xref:nng_socket.5.adoc[nng_socket(5)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_compat.3compat.adoc b/docs/man/nng_compat.3compat.adoc
deleted file mode 100644
index bd986597..00000000
--- a/docs/man/nng_compat.3compat.adoc
+++ /dev/null
@@ -1,214 +0,0 @@
-= nng_compat(3compat)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_compat - compatibility with nanomsg 1.0
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nanomsg/nn.h>
-
-#include <nanomsg/bus.h>
-#include <nanomsg/pair.h>
-#include <nanomsg/pipeline.h>
-#include <nanomsg/pubsub.h>
-#include <nanomsg/reqrep.h>
-#include <nanomsg/survey.h>
-
-#include <nanomsg/inproc.h>
-#include <nanomsg/ipc.h>
-#include <nanomsg/tcp.h>
-#include <nanomsg/ws.h>
-----
-
-== DESCRIPTION
-
-(((compatibility layer)))
-xref:nng.7.adoc[_NNG_] provides source-level compatibility for
-most _libnanomsg_ 1.0 applications.
-
-IMPORTANT: This is intended to facilitate converting ((legacy applications)) to
-use _NNG_.
-New applications should use the newer xref:nng.7.adoc[_NNG_] API instead.
-
-Applications making use of this must take care
-to link with xref:libnng.3.adoc[_libnng_] instead of _libnn_.
-
-TIP: While not recommended for long term use, the value returned by
-xref:nng_socket_id.3.adoc[`nng_socket_id()`] can be used with these functions
-just like a value returned by xref:nn_socket.3compat.adoc[`nn_socket()`].
-This can be way to facilitate incremental transition to the new API.
-
-NOTE: Some capabilities, protocols, and transports, will not be accessible
-using this API, as the compatible API has no provision for expression
-of certain concepts introduced in the new API.
-
-NOTE: While reasonable efforts have been made to provide for compatibility,
-some things may behave differently, and some less common parts of the
-_libnanomsg_ 1.0 API are not supported at this time, including certain
-options and the statistics API.
-See the <<Caveats>> section below.
-
-=== Compiling
-
-When compiling legacy _nanomsg_ applications, it will generally be
-necessary to change the include search path to add the `compat` subdirectory
-of the directory where headers were installed.
-For example, if _NNG_ is installed in `$prefix`, then header files will
-normally be located in `$prefix/include/nng`.
-In this case, to build legacy _nanomsg_ apps against _NNG_ you would
-add `$prefix/include/nng/compat` to your compiler's search path.
-
-Alternatively, you can change your source code so that `#include` statements
-referring to `<nanomsg>` instead refer to `<nng/compat/nanomsg>`.
-For example, instead of:
-
-[source,c]
-----
-#include <nanomsg/nn.h>
-#include <nanomsg/reqrep.h>
-----
-
-you would have this:
-
-[source,c]
-----
-#include <nng/compat/nanomsg/nn.h>
-#include <nng/compat/nanomsg/reqrep.h>
-----
-
-Legacy applications built using these methods should be linked against _libnng_
-instead of _libnn_, just like any other _NNG_ application.
-
-=== Functions
-
-The following functions are provided:
-
-// For PDF, we don't have horizontal lists, so we have to conditionalize
-// this and use tables there -- it looks ugly otherwise.
-ifndef::backend-pdf[]
-[horizontal]
-xref:nn_socket.3compat.adoc[`nn_socket()`]:: create socket
-xref:nn_getsockopt.3compat.adoc[`nn_getsockopt()`]:: get socket option
-xref:nn_setsockopt.3compat.adoc[`nn_setsockopt()`]:: set socket option
-xref:nn_bind.3compat.adoc[`nn_bind()`]:: accept connections from remote peers
-xref:nn_connect.3compat.adoc[`nn_connect()`]:: connect to remote peer
-xref:nn_send.3compat.adoc[`nn_send()`]:: send data
-xref:nn_recv.3compat.adoc[`nn_recv()`]:: receive data
-xref:nn_shutdown.3compat.adoc[`nn_shutdown()`]:: shut down endpoint
-xref:nn_close.3compat.adoc[`nn_close()`]:: close socket
-xref:nn_poll.3compat.adoc[`nn_poll()`]:: poll sockets
-xref:nn_device.3compat.adoc[`nn_device()`]:: create forwarding device
-xref:nn_recvmsg.3compat.adoc[`nn_recvmsg()`]:: receive message
-xref:nn_sendmsg.3compat.adoc[`nn_sendmsg()`]:: send message
-xref:nn_cmsg.3compat.adoc[`nn_cmsg()`]:: message control data
-xref:nn_get_statistic.3compat.adoc[`nn_get_statistic()`]:: get statistic (stub)
-xref:nn_allocmsg.3compat.adoc[`nn_allocmsg()`]:: allocate message
-xref:nn_reallocmsg.3compat.adoc[`nn_reallocmsg()`]:: reallocate message
-xref:nn_freemsg.3compat.adoc[`nn_freemsg()`]:: free message
-xref:nn_errno.3compat.adoc[`nn_errno()`]:: return most recent error
-xref:nn_strerror.3compat.adoc[`nn_strerror()`]:: return message for error
-xref:nn_term.3compat.adoc[`nn_term()`]:: terminate library
-endif::[]
-ifdef::backend-pdf[]
-// Add links for the following as they are written.
-[.hdlist,width=90%, grid=rows,cols="1,2", align="center"]
-|===
-|xref:nn_socket.3compat.adoc[`nn_socket()`]|create socket
-|xref:nn_getsockopt.3compat.adoc[`nn_getsockopt()`]|get socket option
-|xref:nn_setsockopt.3compat.adoc[`nn_setsockopt()`]|set socket option
-|xref:nn_bind.3compat.adoc[`nn_bind()`]|accept connections from remote peers
-|xref:nn_connect.3compat.adoc[`nn_connect()`]|connect to remote peer
-|xref:nn_send.3compat.adoc[`nn_send()`]|send data
-|xref:nn_recv.3compat.adoc[`nn_recv()`]|receive data
-|xref:nn_shutdown.3compat.adoc[`nn_shutdown()`]|shut down endpoint
-|xref:nn_close.3compat.adoc[`nn_close()`]|close socket
-|xref:nn_poll.3compat.adoc[`nn_poll()`]|poll sockets
-|xref:nn_device.3compat.adoc[`nn_device()`]|create forwarding device
-|xref:nn_recvmsg.3compat.adoc[`nn_recvmsg()`]|receive message
-|xref:nn_sendmsg.3compat.adoc[`nn_sendmsg()`]|send message
-|xref:nn_cmsg.3compat.adoc[`nn_cmsg()`]|message control data
-|xref:nn_get_statistic.3compat.adoc[`nn_get_statistic()`]|get statistic (stub)
-|xref:nn_allocmsg.3compat.adoc[`nn_allocmsg()`]|allocate message
-|xref:nn_reallocmsg.3compat.adoc[`nn_reallocmsg()`]|reallocate message
-|xref:nn_freemsg.3compat.adoc[`nn_freemsg()`]|free message
-|xref:nn_errno.3compat.adoc[`nn_errno()`]|return most recent error
-|xref:nn_strerror.3compat.adoc[`nn_strerror()`]|return message for error
-|xref:nn_term.3compat.adoc[`nn_term()`]|terminate library
-|===
-endif::[]
-
-=== Caveats
-
-The following caveats apply when using the legacy API with _NNG_.
-
-* Socket numbers can be quite large.
- The legacy _libnanomsg_ attempted to reuse socket numbers, like
- file descriptors in UNIX systems.
- _NNG_ avoids this to prevent accidental reuse or
- collision after a descriptor is closed.
- Consequently, socket numbers can become quite large, and should
- probably not be used for array indices.
-
-* The following options (`nn_getsockopt`) are unsupported:
- `NN_SNDPRIO`, `NN_RCVPRIO`, `NN_IPV4ONLY`.
- The priority options may be supported in the future, when
- the underlying capability is present in _NNG_.
-
-* Access to statistics using this legacy API
- (xref:nn_get_statistic.3compat.adoc[`nn_get_statistic()`]) is unsupported.
-
-* Some transports can support longer URLs than legacy _libnanomsg_ can.
- It is a good idea to use short pathnames in URLs if interoperability
- is a concern.
-
-* Only absolute paths are supported in `ipc://` URLs.
- For example, `ipc:///tmp/mysocket` is acceptable, but `ipc://mysocket` is not.
-
-* The WebSocket transport in this implementation (`ws://` URLs)
- only supports BINARY frames.
-
-* Some newer transports are unusable from this mode.
- In particular, this legacy API offers no way to configure
- TLS or ZeroTier parameters that may be required for use.
-
-* ABI versioning of the compatibility layer is not supported,
- and the `NN_VERSION_` macros are not present.
-
-* Runtime symbol information is not implemented.
- Specifically, there is no `nn_symbol()` function yet.
- (This may be addressed later if there is a need.)
-
-* The TCP transport (`tcp://` URLs) does not support specifying the local
- address or interface when binding. (This could be fixed in the future,
- but most likely this will be available only using the new API.)
-
-* The values of `NN_RCVMAXSIZE` are constrained.
- Specifically, values set larger than 2GB using the new API will be reported
- as unlimited (`-1`) in the new API, and the value `0` will disable any
- enforcement, just like `-1`.
- (There is no practical reason to ever want to limit the receive size to
- zero.)
-
-* This implementation counts buffers in terms of messages rather than bytes.
- As a result, the buffer sizes accessed with `NN_SNDBUF` and `NN_RCVBUF` are
- rounded up to a whole number of kilobytes, then divided by 1024, in order
- to approximate buffering assuming 1 KB messages.
- Few applications should need to adjust the default values.
-
-== SEE ALSO
-
-[.text-left]
-xref:libnng.3.adoc[libnng(3)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_ctx.5.adoc b/docs/man/nng_ctx.5.adoc
deleted file mode 100644
index c8ab62cd..00000000
--- a/docs/man/nng_ctx.5.adoc
+++ /dev/null
@@ -1,176 +0,0 @@
-= nng_ctx(5)
-//
-// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_ctx - protocol context
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-
-typedef struct nng_ctx_s nng_ctx
-----
-
-== DESCRIPTION
-
-An `nng_ctx`(((context))) is a handle to an underlying context object,
-which keeps the protocol state for some stateful protocols.
-The purpose of a separate context object is to permit applications to
-share a single socket, with its various underlying
-xref:nng_dialer.5.adoc[dialers],
-xref:nng_listener.5.adoc[listeners],
-and xref:nng_pipe.5.adoc[pipes],
-while still benefiting from separate state tracking.
-
-For example, a xref:nng_req.7.adoc[_req_] context will contain the request ID
-of any sent request, a timer to retry the request on failure, and so forth.
-A separate context on the same socket can have similar data, but corresponding
-to a completely different request.
-
-IMPORTANT: The `nng_ctx` structure is always passed by value (both
-for input parameters and return values), and should be treated opaquely.
-Passing structures this way gives the compiler a chance to perform
-accurate type checks in functions passing values of this type.
-
-All contexts share the same socket, and so some options, as well as the
-underlying transport details, will be common to all contexts on that socket.
-
-NOTE: Not every protocol supports separate contexts.
-See the protocol-specific documentation for further details about whether
-contexts are supported, and details about what options are supported for
-contexts.
-
-Protocols that make use of contexts will also have a default context
-that is used when the socket global operations are used.
-Operations using the global context will generally not interfere with
-any other contexts, except that certain socket options may affect socket
-global behavior.
-
-(((concurrent)))(((raw mode)))
-Historically, applications wanting to use a stateful protocol concurrently
-would have to resort to xref:nng.7.adoc#raw_mode[raw mode] sockets, which bypasses
-much of the various protocol handling, leaving it to up to the application
-to do so.
-Contexts make it possible to still benefit from advanced protocol handling,
-including timeouts, retries, and matching requests to responses, while doing so
-concurrently.
-
-NOTE: xref:nng.7.adoc#raw_mode[Raw mode] sockets do not support contexts, since
-there is generally no state tracked for them, and thus contexts make no sense.
-
-TIP: Contexts are an excellent mechanism to use when building concurrent
-applications, and should be used in lieu of
-xref:nng.7.adoc#raw_mode[raw mode] sockets when possible.
-
-IMPORTANT: Use of file descriptor polling (with descriptors
-obtained using the
-xref:nng_options.5.adoc#NNG_OPT_RECVFD[`NNG_OPT_RECVFD`] or
-xref:nng_options.5.adoc#NNG_OPT_SENDFD[`NNG_OPT_SENDFD`] options) while contexts
-are in use on the same socket is not supported, and may lead to unpredictable
-behavior.
-These asynchronous methods should not be mixed on the same socket.
-
-[[NNG_CTX_INITIALIZER]]
-=== Initialization
-
-A context may be initialized using the macro `NNG_CTX_INITIALIZER`
-before it is opened, to prevent confusion with valid open contexts.
-
-== EXAMPLE
-
-The following program fragment demonstrates the use of contexts to implement
-a concurrent xref:nng_rep.7.adoc[_rep_] service that simply echos messages back
-to the sender.
-
-[source, c]
-----
-
-struct echo_context {
- nng_ctx ctx;
- nng_aio *aio;
- enum { INIT, RECV, SEND } state;
-};
-
-void
-echo(void *arg)
-{
- struct echo_context *ec = arg;
-
- switch (ec->state) {
- case INIT:
- ec->state = RECV;
- nng_ctx_recv(ec->ctx, ec->aio);
- return;
- case RECV:
- if (nng_aio_result(ec->aio) != 0) {
- // ... handle error
- }
- // We reuse the message on the ec->aio
- ec->state = SEND;
- nng_ctx_send(ec->ctx, ec->aio);
- return;
- case SEND:
- if (nng_aio_result(ec->aio) != 0) {
- // ... handle error
- }
- ec->state = RECV;
- nng_ctx_recv(ec->ctx, ec->aio);
- return;
- }
-}
-----
-
-Given the above fragment, the following example shows setting up the
-service. It assumes that the xref:nng_socket.5.adoc[socket] has already been
-created and any transports set up as well with functions such as
-xref:nng_dial.3.adoc[`nng_dial()`]
-or xref:nng_listen.3.adoc[`nng_listen()`].
-
-[source,c]
-----
-#define CONCURRENCY 1024
-
-echo_context ecs[CONCURRENCY];
-
-void
-start_echo_service(nng_socket rep_socket)
-{
- for (int i = 0; i < CONCURRENCY; i++) {
- // error checks elided for clarity
- nng_ctx_open(ec[i].ctx, rep_socket)
- nng_aio_alloc(ec[i].aio, echo, &e[i]);
- ec[i].state = INIT;
- echo(&ec[i]); // start it running
- }
-}
-----
-
-== SEE ALSO
-
-[.text-left]
-xref:libnng.3.adoc[libnng(3)],
-xref:nng_ctx_close.3.adoc[nng_ctx_close(3)],
-xref:nng_ctx_open.3.adoc[nng_ctx_open(3)],
-xref:nng_ctx_get.3.adoc[nng_ctx_get(3)],
-xref:nng_ctx_id.3.adoc[nng_ctx_id(3)],
-xref:nng_ctx_recv.3.adoc[nng_ctx_recv(3)],
-xref:nng_ctx_recvmsg.3.adoc[nng_ctx_recvmsg(3)],
-xref:nng_ctx_send.3.adoc[nng_ctx_send(3)],
-xref:nng_ctx_sendmsg.3.adoc[nng_ctx_sendmsg(3)],
-xref:nng_ctx_set.3.adoc[nng_ctx_set(3)],
-xref:nng_dialer.5.adoc[nng_dialer(5)],
-xref:nng_listener.5.adoc[nng_listener(5)],
-xref:nng_socket.5.adoc[nng_socket(5)],
-xref:nng_options.5.adoc[nng_options(5)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_cv_alloc.3supp.adoc b/docs/man/nng_cv_alloc.3supp.adoc
deleted file mode 100644
index 9e58e3f1..00000000
--- a/docs/man/nng_cv_alloc.3supp.adoc
+++ /dev/null
@@ -1,60 +0,0 @@
-= nng_cv_alloc(3supp)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_cv_alloc - allocate condition variable
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-typedef struct nng_cv nng_cv;
-
-int nng_cv_alloc(nng_cv **cvp, nng_mtx *mtx);
-----
-
-== DESCRIPTION
-
-The `nng_cv_alloc()` function allocates a condition variable, using
-the mutex _mtx_, and returns it in _cvp_.
-
-Every condition variable is associated with a mutex, which must be
-owned when a thread waits for the condition using
-xref:nng_cv_wait.3supp.adoc[`nng_cv_wait()`] or
-xref:nng_cv_until.3supp.adoc[`nng_cv_until()`].
-The mutex must also be owned when signaling the condition using the
-xref:nng_cv_wake.3supp.adoc[`nng_cv_wake()`] or
-xref:nng_cv_wake1.3supp.adoc[`nng_cv_wake1()`] functions.
-
-== RETURN VALUES
-
-This function returns 0 on success, and non-zero otherwise.
-
-== ERRORS
-
-[horizontal]
-`NNG_ENOMEM`:: Insufficient free memory exists.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_cv_free.3supp.adoc[nng_cv_free(3supp)],
-xref:nng_cv_until.3supp.adoc[nng_cv_until(3supp)],
-xref:nng_cv_wait.3supp.adoc[nng_cv_wait(3supp)],
-xref:nng_cv_wake.3supp.adoc[nng_cv_wake(3supp)],
-xref:nng_cv_wake1.3supp.adoc[nng_cv_wake1(3supp)],
-xref:nng_mtx_alloc.3supp.adoc[nng_mtx_alloc(3supp)],
-xref:nng_strerror.3.adoc[nng_strerror(3)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_cv_free.3supp.adoc b/docs/man/nng_cv_free.3supp.adoc
deleted file mode 100644
index 0610b52f..00000000
--- a/docs/man/nng_cv_free.3supp.adoc
+++ /dev/null
@@ -1,42 +0,0 @@
-= nng_cv_free(3supp)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_cv_free - free condition variable
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-void nng_cv_free(nng_cv *cv);
-----
-
-== DESCRIPTION
-
-The `nng_cv_free()` function frees the condition variable _cv_.
-
-== RETURN VALUES
-
-None.
-
-== ERRORS
-
-None.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_cv_alloc.3supp.adoc[nng_cv_alloc(3supp)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_cv_until.3supp.adoc b/docs/man/nng_cv_until.3supp.adoc
deleted file mode 100644
index 9cf7c714..00000000
--- a/docs/man/nng_cv_until.3supp.adoc
+++ /dev/null
@@ -1,91 +0,0 @@
-= nng_cv_until(3supp)
-//
-// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_cv_until - wait for condition or timeout
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-int nng_cv_until(nng_cv *cv, nng_time when);
-----
-
-== DESCRIPTION
-
-The `nng_cv_until()` waits until either the condition variable _cv_ is signaled
-by another thread calling either xref:nng_cv_wake.3supp.adoc[`nng_cv_wake()`] or
-xref:nng_cv_wake1.3supp.adoc[`nng_cv_wake1()`], or the system clock (as tracked
-by xref:nng_clock.3supp.adoc[`nng_clock()`]) reaches _when_.
-
-The caller must have have ownership of the mutex that was used when
-_cv_ was allocated.
-This function will drop the ownership of that mutex, and reacquire it
-atomically just before returning to the caller.
-(The waiting is done without holding the mutex.)
-
-NOTE: Any condition may be used or checked, but the condition must be
-checked, as it is possible for this function to wake up spuriously.
-The best way to do this is inside a loop that repeats until the condition
-tests for true.
-
-== EXAMPLE
-
-The following example demonstrates use of this function:
-
-.Example 1: Waiting for the condition
-[source, c]
-----
-
- expire = nng_clock() + 1000; // 1 second in the future
- nng_mtx_lock(m); // assume cv was allocated using m
- while (!condition_true) {
- if (nng_cv_until(cv, expire) == NNG_ETIMEDOUT) {
- printf("Time out reached!\n");
- break;
- }
- }
- // condition_true is true
- nng_mtx_unlock(m);
-----
-
-.Example 2: Signaling the condition
-[source, c]
-----
- nng_mtx_lock(m);
- condition_true = true;
- nng_cv_wake(cv);
- nng_mtx_unlock(m);
-----
-
-== RETURN VALUES
-
-None.
-
-== ERRORS
-
-None.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_cv_alloc.3supp.adoc[nng_cv_alloc(3supp)],
-xref:nng_cv_wait.3supp.adoc[nng_cv_wait(3supp)],
-xref:nng_cv_wake.3supp.adoc[nng_cv_wake(3supp)],
-xref:nng_cv_wake1.3supp.adoc[nng_cv_wake1(3supp)],
-xref:nng_mtx_alloc.3supp.adoc[nng_mtx_alloc(3supp)],
-xref:nng_mtx_lock.3supp.adoc[nng_mtx_lock(3supp)],
-xref:nng_mtx_unlock.3supp.adoc[nng_mtx_unlock(3supp)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_cv_wait.3supp.adoc b/docs/man/nng_cv_wait.3supp.adoc
deleted file mode 100644
index 1d9c16be..00000000
--- a/docs/man/nng_cv_wait.3supp.adoc
+++ /dev/null
@@ -1,86 +0,0 @@
-= nng_cv_wait(3supp)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_cv_wait - wait for condition
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-void nng_cv_wait(nng_cv *cv);
-----
-
-== DESCRIPTION
-
-The `nng_cv_wait()` waits for the condition variable _cv_ to be signaled
-by another thread calling either xref:nng_cv_wake.3supp.adoc[`nng_cv_wake()`] or
-xref:nng_cv_wake1.3supp.adoc[`nng_cv_wake1()`].
-
-The caller must have have ownership of the mutex that was used when
-_cv_ was allocated.
-This function will drop the ownership of that mutex, and reacquire it
-atomically just before returning to the caller.
-(The waiting is done without holding the mutex.)
-
-NOTE: Any condition may be used or checked, but the condition must be
-checked, as it is possible for this function to wake up spuriously.
-The best way to do this is inside a loop that repeats until the condition
-tests for true.
-
-== EXAMPLE
-
-The following example demonstrates use of this function:
-
-.Example 1: Waiting for the condition
-[source, c]
-----
-
- nng_mtx_lock(m); // assume cv was allocated using m
- while (!condition_true) {
- nng_cv_wait(cv);
- }
- // condition_true is true
- nng_mtx_unlock(m);
-----
-
-.Example 2: Signaling the condition
-[source, c]
-----
- nng_mtx_lock(m);
- condition_true = true;
- nng_cv_wake(cv);
- nng_mtx_unlock(m);
-----
-
-== RETURN VALUES
-
-None.
-
-== ERRORS
-
-None.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_cv_alloc.3supp.adoc[nng_cv_alloc(3supp)],
-xref:nng_cv_until.3supp.adoc[nng_cv_until(3supp)],
-xref:nng_cv_wake.3supp.adoc[nng_cv_wake(3supp)],
-xref:nng_cv_wake1.3supp.adoc[nng_cv_wake1(3supp)],
-xref:nng_mtx_alloc.3supp.adoc[nng_mtx_alloc(3supp)],
-xref:nng_mtx_lock.3supp.adoc[nng_mtx_lock(3supp)],
-xref:nng_mtx_unlock.3supp.adoc[nng_mtx_unlock(3supp)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_cv_wake.3supp.adoc b/docs/man/nng_cv_wake.3supp.adoc
deleted file mode 100644
index 6ee2945d..00000000
--- a/docs/man/nng_cv_wake.3supp.adoc
+++ /dev/null
@@ -1,61 +0,0 @@
-= nng_cv_wake(3supp)
-//
-// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_cv_wake - wake all waiters
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-void nng_cv_wake(nng_cv *cv);
-----
-
-== DESCRIPTION
-
-The `nng_cv_wake()` wakes any threads waiting for the condition variable _cv_
-to be signaled in the xref:nng_cv_wait.3supp.adoc[`nng_cv_wait()`] or
-xref:nng_cv_until.3supp.adoc[`nng_cv_until()`] functions.
-
-The caller must have have ownership of the mutex that was used when
-_cv_ was allocated.
-
-NOTE: The caller should already have set the condition that the waiters
-will check, while holding the mutex.
-
-TIP: This function wakes all threads, which is generally safer but can
-lead to a performance problem when there are many waiters, as they are all
-woken simultaneously and may contend for resources.
-See xref:nng_cv_wake1.3supp.adoc[`nng_cv_wake1()`] for a solution to this problem.
-
-== RETURN VALUES
-
-None.
-
-== ERRORS
-
-None.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_cv_alloc.3supp.adoc[nng_cv_alloc(3supp)],
-xref:nng_cv_until.3supp.adoc[nng_cv_until(3supp)],
-xref:nng_cv_wait.3supp.adoc[nng_cv_wait(3supp)],
-xref:nng_cv_wake1.3supp.adoc[nng_cv_wake1(3supp)],
-xref:nng_mtx_alloc.3supp.adoc[nng_mtx_alloc(3supp)],
-xref:nng_mtx_lock.3supp.adoc[nng_mtx_lock(3supp)],
-xref:nng_mtx_unlock.3supp.adoc[nng_mtx_unlock(3supp)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/man/nng_cv_wake1.3supp.adoc b/docs/man/nng_cv_wake1.3supp.adoc
deleted file mode 100644
index 4f8b8326..00000000
--- a/docs/man/nng_cv_wake1.3supp.adoc
+++ /dev/null
@@ -1,61 +0,0 @@
-= nng_cv_wake1(3supp)
-//
-// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
-// Copyright 2018 Capitar IT Group BV <info@capitar.com>
-//
-// This document is supplied under the terms of the MIT License, a
-// copy of which should be located in the distribution where this
-// file was obtained (LICENSE.txt). A copy of the license may also be
-// found online at https://opensource.org/licenses/MIT.
-//
-
-== NAME
-
-nng_cv_wake1 - wake one waiter
-
-== SYNOPSIS
-
-[source, c]
-----
-#include <nng/nng.h>
-#include <nng/supplemental/util/platform.h>
-
-void nng_cv_wake1(nng_cv *cv);
-----
-
-== DESCRIPTION
-
-The `nng_cv_wake1()` wakes at most one thread waiting for the condition
-variable _cv_
-to be signaled in the xref:nng_cv_wait.3supp.adoc[`nng_cv_wait()`] or
-xref:nng_cv_until.3supp.adoc[`nng_cv_until()`] functions.
-
-The caller must have have ownership of the mutex that was used when
-_cv_ was allocated.
-
-NOTE: The caller should already have set the condition that the waiters
-will check, while holding the mutex.
-
-NOTE: The caller cannot predict which waiter will be woken, and so the design must
-ensure that it is sufficient that _any_ waiter be woken.
-When in doubt, it is safer to use xref:nng_cv_wake.3supp.adoc[`nng_cv_wake()`].
-
-== RETURN VALUES
-
-None.
-
-== ERRORS
-
-None.
-
-== SEE ALSO
-
-[.text-left]
-xref:nng_cv_alloc.3supp.adoc[nng_cv_alloc(3supp)],
-xref:nng_cv_until.3supp.adoc[nng_cv_until(3supp)],
-xref:nng_cv_wait.3supp.adoc[nng_cv_wait(3supp)],
-xref:nng_cv_wake.3supp.adoc[nng_cv_wake(3supp)],
-xref:nng_mtx_alloc.3supp.adoc[nng_mtx_alloc(3supp)],
-xref:nng_mtx_lock.3supp.adoc[nng_mtx_lock(3supp)],
-xref:nng_mtx_unlock.3supp.adoc[nng_mtx_unlock(3supp)],
-xref:nng.7.adoc[nng(7)]
diff --git a/docs/reference/src/api/protocol.md b/docs/reference/src/api/socket/index.md
index 990b7cbb..990b7cbb 100644
--- a/docs/reference/src/api/protocol.md
+++ b/docs/reference/src/api/socket/index.md
diff --git a/docs/reference/src/api/nng_bus_open.md b/docs/reference/src/api/socket/nng_bus_open.md
index a579acfb..a579acfb 100644
--- a/docs/reference/src/api/nng_bus_open.md
+++ b/docs/reference/src/api/socket/nng_bus_open.md
diff --git a/docs/reference/src/api/nng_close.md b/docs/reference/src/api/socket/nng_close.md
index 486cfe2c..486cfe2c 100644
--- a/docs/reference/src/api/nng_close.md
+++ b/docs/reference/src/api/socket/nng_close.md
diff --git a/docs/man/nng_pub_open.3.adoc b/docs/reference/src/api/socket/nng_pub_open.md
index c9f3b5b5..c9f3b5b5 100644
--- a/docs/man/nng_pub_open.3.adoc
+++ b/docs/reference/src/api/socket/nng_pub_open.md
diff --git a/docs/reference/src/api/nng_cv_alloc.md b/docs/reference/src/api/threads/nng_cv_alloc.md
index 7379df7e..7379df7e 100644
--- a/docs/reference/src/api/nng_cv_alloc.md
+++ b/docs/reference/src/api/threads/nng_cv_alloc.md
diff --git a/docs/reference/src/api/nng_cv_free.md b/docs/reference/src/api/threads/nng_cv_free.md
index 87412ce9..87412ce9 100644
--- a/docs/reference/src/api/nng_cv_free.md
+++ b/docs/reference/src/api/threads/nng_cv_free.md
diff --git a/docs/reference/src/api/nng_cv_until.md b/docs/reference/src/api/threads/nng_cv_until.md
index 34669953..34669953 100644
--- a/docs/reference/src/api/nng_cv_until.md
+++ b/docs/reference/src/api/threads/nng_cv_until.md
diff --git a/docs/reference/src/api/nng_cv_wait.md b/docs/reference/src/api/threads/nng_cv_wait.md
index 1f4ddf42..1f4ddf42 100644
--- a/docs/reference/src/api/nng_cv_wait.md
+++ b/docs/reference/src/api/threads/nng_cv_wait.md
diff --git a/docs/reference/src/api/nng_cv_wake.md b/docs/reference/src/api/threads/nng_cv_wake.md
index e83fa96d..e83fa96d 100644
--- a/docs/reference/src/api/nng_cv_wake.md
+++ b/docs/reference/src/api/threads/nng_cv_wake.md
diff --git a/docs/reference/src/api/nng_cv_wake1.md b/docs/reference/src/api/threads/nng_cv_wake1.md
index 1c70388d..1c70388d 100644
--- a/docs/reference/src/api/nng_cv_wake1.md
+++ b/docs/reference/src/api/threads/nng_cv_wake1.md
diff --git a/docs/man/nng_random.3supp.adoc b/docs/reference/src/api/util/nng_random.md
index 3f8ac39e..3f8ac39e 100644
--- a/docs/man/nng_random.3supp.adoc
+++ b/docs/reference/src/api/util/nng_random.md
diff --git a/docs/man/nng_strerror.3.adoc b/docs/reference/src/api/util/nng_strerror.md
index 145fd0bc..145fd0bc 100644
--- a/docs/man/nng_strerror.3.adoc
+++ b/docs/reference/src/api/util/nng_strerror.md