nng-c
High level bindings to nng.
Version corresponds to C library
Features
http
- Enables http transport;tls
- Enables TLS transport;websocket
- Enables websocket transport. Implieshttp
feature;log
- Enables logging via log crate;tracing
- Enables logging via tracing crate.
Usage
Basic example of client and server communication
use ;
use time;
//Feel free to append zero char to avoid unnecessary allocations
const ADDR: &str = "ipc://nng-c-example\0";
const REQ_TIMEOUT: Req = Req ;
let server = spawn;
//Wait for thread to spin
sleep;
let client = req0.expect;
client.set_opt.expect;
client.connect.expect;
let mut msg = new.expect;
msg.append.expect;
client.send_msg.expect;
let mut msg = new.expect;
msg.append.expect;
client.send_msg.expect;
server.join.expect;