Version 1.7.0 Feature Release
Welcome to 2024! As a New Year's gift to you, we present version 1.7.0 of NNG.
This release contains the following notable changes:
-
A new compile time setting,
NNG_MAX_POLLER_THREADS
is introduced, with a default value of 8, and will limit the number of threads
used for pollers that are concurrent (currently only Windows). Additionally, for single core systems only two threads will be started instead of four. -
A new supplemental API, nng_id_map(3), is made available. This exposes the internal ID hash API NNG uses mapping integer IDs
(like socket IDs) to data structures. It also brings back support for 64-bit IDs. See bug #1740. -
Setting the
NNG_OPT_RECVMAXSZ
setting no longer affects pipes that are already established. The old behavior was undocumented
and racy. Please set this setting before starting any listeners or dialers. -
A new transport (experimental), for
socket://
is available. This allows a connection using sockets created withsocketpair()
(or the newnng_socket_pair()
supplemental API), which can help use cases where file descriptors are passed between processes or inherited viafork()
. This API is only available on Linux. It does have somewhat different semantics for establishing the connection, so please see the manual page fornng_socket(5)
for more information. -
WebSocket close is fixed to conform to RFC 6455, sending the close frame, and waiting to receive the close frame from the peer. This allows websocket based connections to ensure that data messages are fully delivered before shutting down. See bugs #1733, #1734 and #1735. Thanks @alawn-wang for the inspiration and a first draft of the change.
-
The REQ and SURVEYOR protocols were fixed to improve scalability when many clients or many contexts are used. As part of this change, a new option,
NNG_OPT_REQ_RESENDTICK
is available to adjust how often we check for expired requests. See bug #1663. -
A new ability to override compile-time settings for thread counts is available. This facility is considered experimental, and is not documented in manual pages -- and is subject to change without notice. Please see nng_init_set_parameter() in the nng.h header file. The values that can be tuned are listed there along with comments describing their use. See bug #1572.
-
As part of the fixes for #1572, tunable values for setting fixed values (rather upper limits) for thread counts are now exposed properly via CMake variables. These are
NNG_NUM_EXPIRE_THREADS
andNNG_NUM_TASKQ_THREADS
. -
A new API,
nng_aio_set_expire()
is introduced as a complement tonng_aio_set_timeout()
. This provides absolute expiration times, which may be easier in circumstances involving multiple actions such as common state-machine based idioms. -
A bug which caused TLS connections to spin on accept, causing high CPU usage, is fixed. See bug #1673.
-
The separate thread created for the timer is removed. See bug #1729.
-
Various minor documentation fixes were made, some contributed by Patrik Wenger patrik.wenger@mindclue.ch.