nng-c-sys
Bindings to nng.
Version corresponds to C library
High level bindings: nng-c
Features
http- Builds with http code ONwebsocket- Builds with websocket code ON. Enableshttpalongsidetls- Builds with TLS using vendored mbedtlstls-no-vendored- Builds with TLS, but assumembedtlsis available as dynamic library in default paths (e.g./usr/lib64)tls-pkg-config- Builds with TLS, but usepkg-configto discovermbedtlsstats- 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
- Download new version extracting only
cmake/,include/,src/,CMakeLists.txtandLICENSE.txt - Apply nng.patch to ensure build correctness
- Ensure constants
NNG_OPT_*end with\0character in lib.rs - 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 allpub type Type =definitions within enum modules are defined aspub type Type = core::ffi::c_intrather thanc_uint