So I've worked out how to get ZeroMQ error messages like so:

 

int rc = zmq_bind(server, "tcp://*:5555");

if(rc == -1)

{

std::string errStr =  zmq_strerror(zmq_errno());

std::string errConc = "TestDataAccess: ZMQServer: Bind To REP Failed: " +
errStr;

const char* errOut = errConc.c_str();

OutputDebugStringA(errOut);

return 1;

}

 

Question is; how do I catch ZeroMQ error messages in C++;  say if I wanted
to use:

 

client.connect("tcp://localhost:5555");

 

the obvious way I tried:

 

int rc = client.connect("tcp://localhost:5555");

 

is just not valid because;

 

client.connect("tcp://localhost:5555");

 

returns type 'void'.

 

Can anyone provide a quick C++ example of how to accomplish this?

 

Thanks,

 

Riskybiz.

 

_______________________________________________
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to