Applications desiring to use the richest part of libnng will want to
+use the message API, where a message structure is passed between functions.
+This API provides the most power support for zero-copy.
+
+
+
Messages are divided into a header and body, where the body generally carries
+user-payload and the header carries protocol specific header information.
+Most applications will only interact with the body.
Most applications will interact with nng synchronously; that is that
+functions such as nng_send() will block the calling
+thread until the operation has completed.
+
+
+
+
+
+
+
+
+Synchronous operations which send messages may return before the
+message has actually been received, or even transmitted. Instead, These
+functions return as soon as the message was successfully queued for
+delivery.
+
+
+
+
+
+
Asynchronous operations behave differently. These operations are
+initiated by the calling thread, but control returns immediately to
+the calling thread. When the operation is subsequently completed (regardless
+of whether this was successful or not), then a user supplied function
+("callback") is executed.
+
+
+
A context structure, called an aio, is allocated and associated for
+each asynchronous operation. Only a single asynchronous operation may
+be associated with an aio at any time.
+
+
+
The following functions are used in the asynchronous model:
@@ -540,6 +537,63 @@ other languages please check the website.
+
+
Conceptual Overview
+
+
nng presents a socket view of networking. The sockets are constructed
+using protocol-specific functions, as a given socket implements precisely
+one nng protocol.
+
+
+
Each socket can be used to send and receive messages (if the protocol)
+supports it, and implements the appropriate protocol semantics. For
+example, nng_sub(7) sockets automatically filter incoming
+messages to discard those for topics that have not been subscribed.
+
+
+
nng sockets are message oriented, so that messages are either delivered
+wholly, or not at all. Partial delivery is not possible. Furthermore,
+nng does not provide any other delivery or ordering guarantees;
+messages may be dropped or reordered. (Some protocols, such as
+nng_req(7) may offer stronger guarantees by
+performing their own retry and validation schemes.)
+
+
+
Each socket can have zero, one, or many "endpoints", which are either
+listeners or dialers. (A given socket may freely choose whether it uses
+listeners, dialers, or both.) These "endpoints" provide access to
+underlying transports, such as TCP, etc.
+
+
+
Each endpoint is associated with a URL, which is a service address. For
+dialers, this will be the service address that will be contacted, whereas
+for listeners this is where the listener will bind and watch for new
+connections.
+
+
+
Endpoints do not themselves transport data. They are instead responsible
+for the creation of pipes, which can be thought of as message-oriented,
+connected, streams. Pipes frequently correspond to a single underlying
+byte stream — for example both IPC and TCP transports implement their
+pipes using a 1:1 relationship with a connected socket.
+
+
+
Endpoints create pipes as needed. Listeners will create them when a new
+client connection request arrives, and dialers will generally create one,
+then wait for it to disconnect before reconnecting.
+
+
+
Most applications should not have to worry about endpoints or pipes at
+all; the socket abstraction should provide all the functionality needed
+other than in a few specific circumstances.
The nng_strerror() returns the human-readable description of the
+given nng error in err.
+
+
+
+
+
+
+
+
+The returned error message is provided in US English, but in the
+future locale-specific strings may be presented instead.
+
+
+
+
+
+
+
+
+
+
+
+The specific strings associated with specific error messages are
+subject to change. Therefore applications must not depend on the message,
+but may use them verbatim when supplying information to end-users, such
+as in diagnostic messages or log entries.
+
+
+
+
+
+
+
+
RETURN VALUES
+
+
+
This function returns the human-readable error message, terminated
+by a NUL byte.