
#include "spec.h"

void ZmqInit(Co co){
    co->mmunication = zmq_ctx_new();
    co->pub = zmq_socket(co->mmunication, ZMQ_PUB);
    zmq_bind(co->pub, "inproc://test");
    //they should be initialised in their own thread XD
    co->sub = zmq_socket(co->mmunication, ZMQ_SUB);
    zmq_connect(co->sub, "inproc://test");
}

void ZmqEnd(Co co){
    zmq_close(co->sub);
    zmq_close(co->pub);
    zmq_ctx_destroy(co->mmunication);
}
