From 4acc8b39d0a0dc8a1ade2289372aecc4164db95c Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 18 Mar 2018 21:38:51 -0700 Subject: man page updates for 0.7.0 --- man/v0.7.0/nng.7.html | 770 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 770 insertions(+) create mode 100644 man/v0.7.0/nng.7.html (limited to 'man/v0.7.0/nng.7.html') diff --git a/man/v0.7.0/nng.7.html b/man/v0.7.0/nng.7.html new file mode 100644 index 00000000..35fa9a82 --- /dev/null +++ b/man/v0.7.0/nng.7.html @@ -0,0 +1,770 @@ +--- +version: 0.7.0 +layout: refman +--- + + + + + + + +nng(7) + + + + + + + +
+
+

SYNOPSIS

+
+
+

cc ['flags'] 'files' -lnng ['libraries']

+
+
+
+
+

DESCRIPTION

+
+
+

The nng library provides a common messaging framework intended to +solve common communication problems in distributed applications. +It offers a number of protocols, and also a number of transports.

+
+
+

The protocols implement the semantics associated with particular +communications scenarios, such as RPC style services, service discovery, +publish/subscribe, and so forth.

+
+
+

The transports provide support for underlying transport methods, such +as TCP, IPC, websockets, and so forth.

+
+
+

The nng library is designed to permit easy creation of new transports and, +to a lesser extent, new protocols.

+
+
+

The nng library is wire compatible with the SP protocols described in +the nanomsg project; projects using +libnanomsg can inter-operate with +nng as well as other conforming implementations. (One such implementation +is mangos.) Applications using nng +which wish to communicate with older libraries must ensure that they only +use protocols or transports offered by the earlier library.

+
+
+

The nng library also offers a compatible API, permitting legacy code to +be recompiled or relinked against nng. When doing this, support for +certain enhancements or features will likely be absent, requiring the +application developer to use the new-style API.

+
+
+

The nng library is implemented in pure C; if you need bindings for +other languages please check the website.

+
+
+
+
+

Protocols

+
+
+ +
+
+
+
+

Transports

+
+
+ +
+
+
+
+

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.

+
+
+

URLs

+
+

+The nng library uses universal resource locators (URLs) +following the format specified in +RFC 3986, +including some schemes that are unique +to SP. + +The URLs used in nng are canonicalized as follows, mostly in +accordance with +RFC 3986 6.2.2:

+
+
+
    +
  1. +

    The URL is parsed into scheme, userinfo, host, port, path, query and +fragment components. (Not all of these members are necessarily present.)

    +
  2. +
  3. +

    The scheme, hostname, and port if present, are converted to lower case.

    +
  4. +
  5. +

    Percent-encoded values for +unreserved characters +converted to their unencoded forms.

    +
  6. +
  7. +

    Additionally URL percent-encoded values for characters in the path +and with numeric values larger than 127 (i.e. not ASCII) are decoded.

    +
  8. +
  9. +

    The resulting path is checked for invalid UTF-8 sequences, consisting +of surrogate pairs, illegal byte sequences, or overlong encodings. +If this check fails, then the entire URL is considered invalid.

    +
  10. +
  11. +

    Path segments consisting of . and .. are resolved as per +RFC 3986 6.2.2.3.

    +
  12. +
  13. +

    Further, empty path segments are removed, meaning that duplicate +slash (/) separators are removed from the path.

    +
  14. +
+
+
+

Note that steps 4, 5, and 7 are not specified by RFC 3986, but performing +them is believed to improve both the usability and security of nng +applications, without violating RFC 3986 itself.

+
+
+
+
+
+

API

+
+
+

The library API is documented at libnng(3).

+
+
+
+
+

SEE ALSO

+ +
+
+ + -- cgit v1.2.3-70-g09d2