[zeromq-dev] Java binding

gonzalo diethelm gdiethelm at dcv.cl
Mon Feb 22 14:44:42 CET 2010

> I am not sure about the interface - the type you use for handles in
> is 'long' which gets translated in C to void*, right?


> Is there any guarantee that Java 'long' type can hold a pointer? I am
> not an expert on Java but storing pointer in a signed integer just
> doesn't sound right.

No guarantees, but there seems to be no other way. I don't know what
would happen in a 64 bit environment. I can only say two things in "my

1. It was already done that way in the Java binding. The final lines in
Context.java used to be:

    /** Opaque data used by JNI driver. */
    private long contextHandle;

2. It is the only way I could find that is "documented" on the Internet.
For example:


Gonzalo Diethelm

Declaración de confidencialidad: Este Mensaje esta destinado para
el uso de la o las personas o entidades a quien ha sido dirigido y
puede contener información reservada y confidencial que no puede
ser divulgada, difundida, ni aprovechada en forma alguna. El uso no
autorizado de la información contenida en este correo podrá ser
sancionado de conformidad con la ley chilena. 
Si usted ha recibido este correo electrónico por error, le pedimos
eliminarlo junto con los archivos adjuntos y avisar inmediatamente
al remitente, respondiendo este mensaje. 

"Before printing this e-mail think if is really necesary".
Disclosure: This Message is to be used by the individual,
individuals or entities that it is addressed to and may include
private and confidential information that may not be disclosed,
made public nor used in any way at all. Unauthorized use of the
information in this electronic mail message may be subject to the
penalties set forth by Chilean law. 
If you have received this electronic mail message in error, we ask
you to destroy the message and its attached file(s) and to
immediately notify the sender by answering this message. 

More information about the zeromq-dev mailing list