From edd3b6bc34f211bd3d58642d0c69ce1b5bb9dc3b Mon Sep 17 00:00:00 2001 From: gdamore Date: Thu, 9 Oct 2025 01:22:20 +0000 Subject: deploy: 9c834956456924df7c885ab8b79573721acaff5c --- ref/migrate/nng1.html | 90 +++++++++++++++++++++++++-------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'ref/migrate/nng1.html') diff --git a/ref/migrate/nng1.html b/ref/migrate/nng1.html index cf8f81ca..7c96bbe2 100644 --- a/ref/migrate/nng1.html +++ b/ref/migrate/nng1.html @@ -264,7 +264,7 @@ between releases or builds of NNG 2.

See the Migrating From libnanomsg chapter for details.

Library Initialization

It is now required for applications to initialize the library explicitly before using it. -This is done using the nng_init function.

+This is done using the nng_init function.

Removed Headers

The following header files are removed, and the declarations they provided are now provided by including <nng/nng.h>. Simply remove any references to them.

@@ -294,9 +294,9 @@ Simply remove any references to them.

The following functions have been renamed as described by the following table. The old names are available by defining the macro NNG1_TRANSITION in your compilation environment.

- - - + + +
Old NameNew Name
nng_closenng_socket_close
nng_recv_aionng_socket_recv
nng_send_aionng_socket_send
nng_closenng_socket_close
nng_recv_aionng_socket_recv
nng_send_aionng_socket_send

Removed Protocol Aliases

@@ -316,13 +316,13 @@ The old names are available by defining the macro NNG1_TRANSITION i

Just add either 0 or 1 (in the case of PAIRv1) to get the protocol desired. (Forcing the version number to be supplied should avoid surprises later as new versions of protocols are added.)

NNG_FLAG_ALLOC Removed

-

The NNG_FLAG_ALLOC flag that allowed a zero copy semantic with nng_send and nng_recv is removed. +

The NNG_FLAG_ALLOC flag that allowed a zero copy semantic with nng_send and nng_recv is removed. This was implemented mostly to aid legacy nanomsg applications, and it was both error prone and still a bit suboptimal in terms of performance.

-

Modern code should use one of nng_sendmsg, nng_recvmsg, nng_socket_send, or nng_socket_recv to get the maximum performance benefit. -Working directly with nng_msg structures gives more control, reduces copies, and reduces allocation activity.

+

Modern code should use one of nng_sendmsg, nng_recvmsg, nng_socket_send, or nng_socket_recv to get the maximum performance benefit. +Working directly with nng_msg structures gives more control, reduces copies, and reduces allocation activity.

Error Code Changes

-

When an operation fails with NNG_ESTOPPED, it means that the associated [nni_aio] object has +

When an operation fails with NNG_ESTOPPED, it means that the associated [nni_aio] object has been permanently stopped and must not be reused. Applications must watch for this error code, and not resubmit an operation that returns it. This is particularly important for callbacks that automatically resubmit operations. Failure to observe this rule will lead to an infinite loop @@ -331,9 +331,9 @@ as any further operations on the object will fail immediately with NNG_EST

AIO Provider API changes

The API used for providers for asynchronous I/O operations has changed slightly.

The following API calls have changed so that they are void returns, and cannot fail. They may silently truncate data.

The HTTP handler objects may not be modified once in use. Previously this would fail with NNG_EBUSY. These checks are removed now, but debug builds will assert if an application tries to do so.

@@ -566,7 +566,7 @@ support for security descriptors altogether in NNG.

Command Line Argument Parser Changes

The supplemental function nng_opts_parse and supporting definitions have moved. This functionality is now supplied by a header only library, available in nng/args.h. -See nng_args_parse for more information.

+See nng_args_parse for more information.

ZeroTier Support Removed

The Layer 2 special ZeroTier transport has been removed. It is possible to use NNG with ZeroTier using TCP/IP, and a future update -- cgit v1.2.3-70-g09d2