[zeromq-dev] Using pyczmq for zcert/zauth only

Michel Pelletier pelletier.michel at gmail.com
Mon Feb 3 19:57:14 CET 2014

On Mon, Feb 3, 2014 at 9:30 AM, Greg Ward <greg at gerg.ca> wrote:

> Hi all --
> But that doesn't work:
> $ cat shadow-ctx.py
> import zmq
> from pyczmq import zctx
> ctx1 = zmq.Context()
> ctx2 = zctx.shadow_zmq_ctx(ctx1)
> Arghghh. Impedance mismatch. Any idea how to make that wrapper work?

Hmm, I thought I had wrapped shadow_zmq_ctx, but you're right I missed it
and I misspoke.  Thanks for the diff I'll add it in.

When I made my statement they were interoperable I assumed the existence of
method for zmq to expose the raw zeromq context object as a cffi cdata
pointer.  I guess what I should have said was *if* zmq exposes a cdata
pointer they can be interoperable via shadow_zmq_ctx.

> The problem is right in the docstring for zctx.underlying():
> def underlying(ctx):
>     """
>     Return low-level 0MQ context object, will be NULL before first socket
>     is created. Use with care.
>     """
> Well, I'm stumped. Has anyone successfully used pyzmq and pyczmq in
> the same script? Care to show the code?
You could create a dummy socket, then you'll get the underlying cdata
pointer.  Note that I don't know if pyzmq provides a way to use that
pointer.  Same problem as above.

I may have misinterpreted it, but I thought Min has said the latest pyzmq
supports authentication and encryption?  If not, I think sending a PR to
pyzmq adding it would be easier than trying to get the libraries compatible
in-process.  Then everybody wins, the libraries can cross-talk (via zmq)
and you get the features you want in one library.


> Thanks --
>        Greg
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20140203/00a19208/attachment.htm>

More information about the zeromq-dev mailing list