nng-c-sys 1.12.4

Bindings nng C library
Documentation

nng-c-sys

Actions Status Crates.io Documentation

Bindings to nng.

Version corresponds to C library

High level bindings: nng-c

Features

  • http - Builds with http code ON
  • websocket - Builds with websocket code ON. Enables http alongside
  • tls - Builds with TLS using vendored mbedtls
  • tls-no-vendored - Builds with TLS, but assume mbedtls is available as dynamic library in default paths (e.g. /usr/lib64)
  • tls-pkg-config - Builds with TLS, but use pkg-config to discover mbedtls
  • stats - Builds with statistics collection. See this for details.

TLS

When tls feature is enabled this crate compiles mbedtls 2.28.10 to bundle it together with nng

Cross compilation

Android

Specify environment variable ANDROID_NDK_HOME which points too root of NDK installation where to look for toolchain file

C code update

  1. Download new version extracting only cmake/, include/, src/, CMakeLists.txt and LICENSE.txt
  2. Apply nng.patch to ensure build correctness
  3. Ensure constants NNG_OPT_* end with \0 character in lib.rs
  4. Due to buggy bindgen it will generate incorrect enum type. While standard doesn't mandate it to be int, it is most often than not is most assumed choice for developers, so you need to ensure that all pub type Type = definitions within enum modules are defined as pub type Type = core::ffi::c_int rather than c_uint