[zeromq-dev] Subscribing in JAVA api

gonzalo diethelm gdiethelm at dcv.cl
Wed May 12 16:30:08 CEST 2010


> If you change the code to always use "env->GetStringUTFLength
(optval);"
> 
> then from your java code you can do "animals.mammals\u0000" for
precise
> match or "animals.mammals" for "wildcard" matching. Keeps things
simple
> since there is no need for passing length which is a bit more error
prone
> and so un-java :-)

I agree it is not very Java-ish. On the other hand, it looks closer to
the original C implementation, so there might be fewer surprises this
way.

I would like input on this from other members in the list.

> The problem w/ strlen (I think) is that it will see the "\u0000" and
> treat that as the end of the string as opposed to including it in the
call
> to zmq_setsockopt

Ok, so strlen() should be replaced with GetStringUTFLength(). That much
is clear.

Thanks again.

-- 
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