[zeromq-dev] Access ZeroMQ Error Messages in C++?
Riskybiz
riskybizLive at live.com
Sun Jul 28 20:01:26 CEST 2013
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130728/1719f2f0/attachment.htm>
More information about the zeromq-dev
mailing list