Skip to content

thomascellerier/rust-zmq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Zeromq bindings.

To build, just run rustc zmq.rc. rust-zmq is a pretty straight forward port of the C API into Rust:

extern mod zmq;

fn main() {
    let ctx = match zmq::init(1) {
      Ok(ctx) => ctx,
      Err(e) => fail!(e.to_str())
    };

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

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

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

Installation

Install for users of rust-zmq:

% cargo install zmq

Install for developers:

% git clone https://github.com/erickt/rust-zmq
% cd rust-zmq
% make deps
% make

About

Rust zeromq bindings.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%