[zeromq-dev] Important: backward incompatible changes for 0MQ/3.0!

gonzalo diethelm gdiethelm at dcv.cl
Mon Mar 28 17:38:29 CEST 2011

> > > Btw, note that 0mq socket type can't be changed from void* to int. I
> wanted
> > > to do that myself but then I realised that the file descriptor table
> is part
> > > of the context rather than global and thus you would have to pass both
> > > context pointer and int:
> > >
> > > zmq_send (context, sock, "A", 1, 0);
> >
> > :-) Heh, it'll have to wait until (context == kernel).
> Indeed, and this is the major reason why we (Martin and myself) care about
> being as close to the API as possible. If we could get sockets as ints in
> 3.0 that would be wonderful; it means that with a future kernel
> implementation you could just relink your application. But it does indeed
> seem impossible to support sockets as ints and multiple contexts at the
> same time.

Another crazy hack suggestion: if you change the representation of context to also be an integer handle, you could encode the {context, socket} pair as two 16 bit (unsigned) integers packed into a 32 bit (unsigned) integer.  Advantages:

1. It would allow you to seamlessly support 0MQ "in kernel".
2. It solves the problem of passing the context around in functions that today only handle a socket.

I will duck and run away now...

Gonzalo Diethelm

More information about the zeromq-dev mailing list