Latest Changes

Differences between version EMPTY and #10754

0a1,65
> Welcome to hxzmq, [[http://www.zeromq.org/bindings:haxe|Haxe language bindings]] for the [[http://zeromq.org|ZeroMQ messaging library]].  It is written and maintained by Richard Smith of [[http://www.rsbatechnology.co.uk|RSBA Technology Ltd]]
> 
> ZeroMQ (shortened to “0MQ”) is a lightweight, fast messaging C library that implements several different message topologies across different transports, both with brokers or “brokerless” designs, or any interesting combination of the two.  It has community – provided bindings for over 15 application languages (including Haxe!) and has been compiled to run on Windows, Linux, iOS and Mac0SX operating systems, amongst others.  0MQ is maintained as an [[https://github.com/zeromq/libzmq|open source project]] by [[http:///www.imatix.com|iMatix Corporation]] and a strong development community, and is licensed under LGPL.
> 
> ===== A Quick Example =====
> This shows a simple filter device that collects data from two different remote publishers and sends it local subscribers:
> <code haxe>
> package ;
> import haxe.io.Bytes;
> import org.zeromq.ZContext;
> import org.zeromq.ZMQ;
> import org.zeromq.ZMsg;
> 
> class Example 
> {
> 	public static function main() {
> 		var context = new ZContext();
> 		var subscriber = context.createSocket(ZMQ_SUB);
> 		subscriber.connect("tcp://192.168.55.112:5556");
> 		subscriber.connect("tcp://192.168.55.201:7721");
> 		subscriber.setsockopt(ZMQ_SUBSCRIBE, Bytes.ofString("NASDAQ"));
> 		
> 		var publisher = context.createSocket(ZMQ_PUB);
> 		publisher.bind("ipc://nasdaq-feed");
> 		
> 		while (true) {
> 			var message = ZMsg.recvMsg(subscriber);
> 			message.send(publisher);
> 		}
> 	}
> }
> </code>
> 
> Ensure that libzmq is installed on your development machine (see: [[http://www.zeromq.org/intro:get-the-software]])
> 
> If you want to use the php target, you must also install the php-zmq 0MQ binding (see [[http://www.zeromq.org/bindings:php]])
> 
> Then install hxzmq from haxelib (or install from source):
> <code>
> haxelib install hxzmq
> </code>
> 
> 
> Compile & run for your chosen target platform, eg:
> 
> //(For cpp on Mac0SX or Linux)://
> <code>
> haxe –lib hxzmq -D HXCPP_M64 –cpp out/Mac64 –cp . –main Example
> cd out/Mac64
> ./Example
> </code>
> 
> //(For neko on Windows)://
> <code>
> haxe –lib hxzmq –neko out/Windows/main.n –cp . –main Example
> cd out/Windows
> neko main.n
> </code>
> 
> //(for php on any platform, running using PHP CLI)://
> <code>
> haxe –lib hxzmq –php out –cp . –main Example
> cd out
> php –f index.php
> </code>
\ No newline at end of file

	
Ver Date Entry Lg User Action
#10755 2011-07-19 12:50:57 com/libs/hxzmq en rjsmith View | Diff
#10754 2011-07-19 12:42:56 com/libs/hxzmq en rjsmith View | Diff
#10753 2011-07-19 12:42:56 com/libs/hxzmq en rjsmith Set title to hxzmq: ZeroMQ binding for Haxe

Previous | Next