Man page - libnng(3)
Packages contains this manual
- nng_inproc(7)
- nng_msg_header(3)
- nng_push_open(3)
- nng_ipc_options(5)
- nng_bus_open(3)
- nng_tls_options(5)
- nng_aio_result(3)
- nng_pipe_socket(3)
- nng_msg(5)
- nng_stat_child(3)
- nng_pipe_get(3)
- nng_dialer_close(3)
- nng_tcp_register(3)
- nng_url_clone(3)
- nng_msg_free(3)
- nng_dialer_set(3)
- nng_sockaddr_zt(5)
- nng_pull(7)
- nng_stat_unit(3)
- nng_wss_register(3)
- nng_socket_proto_id(3)
- nng_ws_register(3)
- nng_pull_open(3)
- nng_stat_type(3)
- nng_stat_next(3)
- nng_listener_close(3)
- nng_setopt(3)
- nng_msg_insert(3)
- nng_aio_cancel(3)
- nng_listener_set(3)
- nng_msg_realloc(3)
- nng_log(3)
- nng_duration(5)
- nng_options(5)
- nng_strfree(3)
- nng_device(3)
- nng_msg_header_insert(3)
- nng_stat_find_listener(3)
- nng_stat_bool(3)
- nng_aio_set_timeout(3)
- nng_iov(5)
- nng_listener_setopt(3)
- nng_pipe_dialer(3)
- nng_msg_append(3)
- nng_aio_finish(3)
- nng_ws(7)
- nng_stream_listener(5)
- nng_aio_set_output(3)
- nng_ctx_get(3)
- nng_stat_find(3)
- nng_dialer_create(3)
- nng_dialer_getopt(3)
- nng_msg_header_len(3)
- nng_sendmsg(3)
- nng_listener_start(3)
- nng_socket(5)
- nng_str_sockaddr(3)
- nng_dialer_id(3)
- nng_msg_alloc(3)
- nng_recv_aio(3)
- nng_stats_free(3)
- nng_listener_getopt(3)
- nng_recvmsg(3)
- nng_ctx_getopt(3)
- nng_ctx_close(3)
- nng_alloc(3)
- nng_stat_string(3)
- nng(7)
- nng_listener_id(3)
- nng_msg_get_pipe(3)
- nng_aio_get_output(3)
- nng_pipe_getopt(3)
- nng_tcp(7)
- nng_pipe_notify(3)
- libnng(3)
- nng_stats_get(3)
- nng_surveyor_open(3)
- nng_aio_defer(3)
- nng_aio_count(3)
- nng_msg_chop(3)
- nng_sockaddr_abstract(5)
- nng_pipe_id(3)
- nng_msg_header_trim(3)
- nng_stream_dialer(5)
- nng_url_parse(3)
- nng_send(3)
- nng_tls_config(5)
- nng_strerror(3)
- nng_req(7)
- nng_dialer_setopt(3)
- nng_ctx(5)
- nng_respondent(7)
- nng_aio_begin(3)
- nng_dialer_get(3)
- nng_pipe_close(3)
- nng_aio_wait(3)
- nng_tcp_options(5)
- nng_ctx_id(3)
- nng_version(3)
- nng_dial(3)
- nng_stat_timestamp(3)
- nng_ipc_register(3)
- nng_stat_find_socket(3)
- nng_aio_set_iov(3)
- nng_rep(7)
- nng_msg_header_chop(3)
- nng_stat_find_dialer(3)
- nng_listener_get(3)
- nng_url(5)
- nng_zt_register(3)
- nng_zerotier(7)
- nng_req_open(3)
- nng_log_set_facility(3)
- nng_sub(7)
- nng_inproc_register(3)
- nng_listener_create(3)
- nng_aio_set_input(3)
- nng_stat_value(3)
- nng_aio_alloc(3)
- nng_ctx_open(3)
- nng_msg_len(3)
- nng_sockaddr_in(5)
- nng_ipc(7)
- nng_aio_get_input(3)
- nng_tls(7)
- nng_socket_raw(3)
- nng_sockaddr_inproc(5)
- nng_dialer_start(3)
- nng_surveyor(7)
- nng_close(3)
- nng_pub_open(3)
- nng_stream(5)
- nng_msg_set_pipe(3)
- nng_aio(5)
- nng_aio_stop(3)
- nng_pipe(5)
- nng_aio_free(3)
- nng_free(3)
- nng_sockaddr_ipc(5)
- nng_log_set_logger(3)
- nng_url_free(3)
- nng_listen(3)
- nng_aio_set_msg(3)
- nng_respondent_open(3)
- nng_rep_open(3)
- nng_getopt(3)
- nng_msg_body(3)
- nng_listener(5)
- nng_log_set_level(3)
- nng_pipe_listener(3)
- nng_aio_get_msg(3)
- nng_push(7)
- nng_socket_get(3)
- nng_ctx_set(3)
- nng_sub_open(3)
- nng_ctx_setopt(3)
- nng_socket(7)
- nng_stat(5)
- nng_tls_register(3)
- nng_sockaddr_in6(5)
- nng_aio_abort(3)
- nng_msg_dup(3)
- nng_socket_set(3)
- nng_send_aio(3)
- nng_recv(3)
- nng_pair(7)
- nng_sockaddr(5)
- nng_ctx_recv(3)
- nng_pair_open(3)
- nng_msg_clear(3)
- nng_sleep_aio(3)
- nng_stat_desc(3)
- nng_dialer(5)
- nng_strdup(3)
- nng_ctx_send(3)
- nng_msg_header_append(3)
- nng_msg_header_clear(3)
- nng_socket_proto_name(3)
- nng_socket_id(3)
- nng_log_get_level(3)
- nng_tls_engine(5)
- nng_pub(7)
- nng_stat_name(3)
- nng_msg_trim(3)
- nng_bus(7)
apt-get install libnng-dev
Manual
LIBNNG
NAMESYNOPSIS
DESCRIPTION
Common Functions
Socket Functions
Connection Management
Message Handling Functions
Message Header Handling
Asynchronous Operations
Protocols
Transports
Protocol Contexts
Devices, Relays
Statistics
URL Object
Logging Support
Supplemental API
Byte Streams
HTTP Support
Common HTTP Functions
HTTP Client Functions
HTTP Server Functions
TLS Configuration Objects
SEE ALSO
NAME
libnng - nanomsg next generation library
SYNOPSIS
cc [ flags ] files -lnng [ libraries ]
DESCRIPTION
NNG provides a common messaging framework intended to solve common communication problems in distributed applications.
It provides a C language API.
Common Functions
The following common functions exist in libnng .
Socket Functions
The following functions operate on sockets.
Connection Management
The following functions are used with either listeners, or dialers. Listeners accept incoming connection requests, and dialers make them.
Message Handling Functions
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.
Message Header Handling
Tip
Few applications will need these functions, as message headers are only used to carry protocol-specific content. However, applications which use raw mode may need to access the header of messages.
Asynchronous Operations
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.
Note
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 is executed.
A context structure, an nng_aio, is allocated and associated with each asynchronous operation. Only a single asynchronous operation may be associated with an nng_aio at any time.
The following functions are used in the asynchronous model:
Protocols
The following functions are used to construct a socket with a specific protocol:
Transports
The following functions are used to register a transport for use. This is no longer necessary, and applications should not call these functions anymore.
Protocol Contexts
The following functions are useful to separate the protocol processing from a socket object, into a separate context. This can allow multiple contexts to be created on a single socket for concurrent applications.
Devices, Relays
The following function family is used to create forwarders or relayers that route messages from one socket to another.
Statistics
The following functions provide access to statistics which can be used to observe program behaviors and as an aid in troubleshooting.
URL Object
Common functionality is supplied for parsing and handling universal resource locators (URLS).
Logging Support
Common functionality for message logging.
Supplemental API
These supplemental functions are not intrinsic to building network applications with NNG , but they are made available as a convenience to aid in creating portable applications.
Byte Streams
These functions are available for use with byte streams. They are considered low-level, for uses where the higher level functions using Scalability Protocols are inappropriate.
Byte streams, represented by nng_stream objects, correspond to underlying connections such as TCP connections or named pipes. They are created by either nng_stream_dialer or nng_stream_listener objects.
HTTP Support
The library may be configured with support for HTTP, and this will be the case if WebSocket support is configured as well. In this case, it is possible to access functionality to support the creation of HTTP (and HTTP/S if TLS support is present) servers and clients.
Common HTTP Functions
The following functions are used to work with HTTP requests, responses, and connections.
HTTP Client Functions
These functions are intended for use with HTTP client applications.
HTTP Server Functions
These functions are intended for use with HTTP server applications.
TLS Configuration Objects
The following functions are used to manipulate transport layer security (TLS) configuration objects. Most of these functions will not be used even by TLS applications.
Note
These functions will only be present if the library has been built with TLS support.
SEE ALSO
nng_compat(3compat), nng(7)