Skip to content
forked from erickt/rust-zmq

Rust zeromq bindings.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

prodigeni/rust-zmq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Zeromq bindings.

Build Status

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

extern crate zmq;

#[link(name = "zmq")] // link against the C library
extern {}

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

	let mut 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

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

About

Rust zeromq bindings.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published