XPCOM Binding

Mozilla XPCOM Binding for 0MQ

Dependencies

ØMQ/2.x or ØMQ/3.x:

http://www.zeromq.org/intro:get-the-software

Source Code

https://github.com/racklin/moz-zeromq

Bug Reporting

https://github.com/racklin/moz-zeromq/issues

Example

// create new zmq context
var zmqContext = Components.classes["@racklin.gmail.com/zmq;1"].createInstance(Components.interfaces.nsIZMQ);

// dump zmq version
// alert or console.log
alert(zmqContext.version);

// init zmq context with io threads number
zmqContext.init(1);

// create socket with type
zmqContext.socket(zmqContext.ZMQ_REQ);

// connect to endpoint
zmqContext.connect("tcp://127.0.0.1:5555");

// send
zmqContext.send("hello world.");

// close socket
zmqContext.close();

// terminate context
zmqContext.term();