[zeromq-dev] How to convert socket_t* to void *zocket so that I can integrate Strawhouse czmq to my c++ ZeroMQ project?

Check Peck comptechgeeky at gmail.com
Tue Dec 16 02:52:42 CET 2014

I am using C++ binding for ZeroMQ in my project and trying to integrate
Strawhouse security pattern in my ZeroMQ project but the problem is I am
using C binding of czmq.

This is the link (http://hintjens.com/blog:49#toc3) I am following to use
Strawhouse security pattern. I have a code like this in my ZeroMQ project
which is using c++ binding -

    m_socket_ptr = new zmq::socket_t(context, ZMQ_PULL);

And here m_socket_ptr is declared as -

    zmq::socket_t* m_socket_ptr;

Now I am not able to understand how to use zsocket_set_zap_domain code in
my ZeroMQ project - If I try do it like below, it gets compiled fine but it
always give Segmentation fault while running.

    m_socket_ptr = new zmq::socket_t(context, ZMQ_PULL);
    zsocket_set_zap_domain (m_socket_ptr, "global"); // this line throws
Segmentation fault

So my question is how can I convert m_socket_ptr to void *zocket so that it
doesn't throw Seg fault. Below is the signature I am able to find for

    void zsocket_set_zap_domain (void *zocket, const char * zap_domain);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141215/1e2c8c14/attachment.htm>

More information about the zeromq-dev mailing list