zeromq 0.6.0-pre.1

A native Rust implementation of ZeroMQ
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
mod async_helpers;

use std::convert::TryInto;
use zeromq::*;

#[async_helpers::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    println!("Start server");
    let mut socket = zeromq::RepSocket::new();
    socket.bind("tcp://127.0.0.1:5555").await?;

    loop {
        let mut repl: String = socket.recv().await?.try_into()?;
        println!("Received: {:?}", repl);
        repl.push_str(" Reply");
        socket.send(repl.into()).await?;
    }
}