Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rust zeromq bindings.
Rust
Branch: master

Merge pull request #73 from dougroyal/zguide/multiple-sockets

add zguide example for multiple socket reader
latest commit 8b65f10409
@erickt authored

README.md

Rust ZeroMQ bindings.

Build Status

Installation

rust-zmq uses cargo to install. Users should add this to their Cargo.toml file:

[dependencies.zmq]
git = "https://github.com/erickt/rust-zmq.git"

Install for developers:

% git clone https://github.com/erickt/rust-zmq
% cd rust-zmq
% cargo build

Usage

rust-zmq is a pretty straight forward port of the C API into Rust:

extern crate zmq;

fn main() {
    let mut ctx = zmq::Context::new();

    let mut socket = match ctx.socket(zmq::REQ) {
      Ok(socket) => { socket },
      Err(e) => { panic!(e) }
    };

    match socket.connect("tcp://127.0.0.1:1234") {
      Ok(()) => (),
      Err(e) => panic!(e)
    }

    match socket.send_str("hello world!", 0) {
      Ok(()) => (),
      Err(e) => panic!(e)
    }
}

You can find more usage examples in https://github.com/erickt/rust-zmq/tree/master/examples.

Something went wrong with that request. Please try again.