"use-strict";

var zmq = require("zmq");
var publisher = {};

exports.initialize = function(config) {
    publisher = new zmq.ZMQSocket(zmq.PUB);
    if (!publisher.bind(config.publisherAddress)) {
        console.log("Unable to bind publisher to address" + config.publisherAddress);
        system.exit(-1);
    }
}

exports.publish = function(wctpData) {
    console.log("Publishing " + wctpData);
    publisher.publish(wctpData);
}