[zeromq-dev] JZMQ socket.setIdentity() doesn't work with ZMQ 4.0.1

Trevor Bernard trevor.bernard at gmail.com
Wed Oct 16 16:08:14 CEST 2013


Hi Joel,

Can you create an issue and a pull request for this in Github?

    https://github.com/zeromq/jzmq/issues?state=open

-Trev


On Wed, Oct 16, 2013 at 11:03 AM, Joel Lauener <Joel.Lauener at cern.ch> wrote:
> Hi,
>
>
>
> After updating to jzmq-master and zeromq-4.0.1, we are experiencing problems
> with Socket.setIdentity() which fails with a nice “Invalid Argument” error.
> Digging a bit in the JZMQ code I found out that setting ZMQ_IDENTITY is
> disabled for ZMQ_VERSION_MAJOR > 3. What are the reason for that!? It seems
> to be there since a long time so most likely it had some use at some point.
>
>
>
> FYI here is the guilty code snippet (same for getBytesSockop).
>
>
>
> JNIEXPORT void JNICALL Java_org_zeromq_ZMQ_00024Socket_setBytesSockopt
> (JNIEnv *env,
>
>
> jobject obj,
>
>                                                                         jint
> option,
>
>
> jbyteArray value)
>
> {
>
>     switch (option) {
>
> #if (ZMQ_VERSION_MAJOR <= 3)
>
>     case ZMQ_IDENTITY:
>
> #endif
>
>     case ZMQ_SUBSCRIBE:
>
>     case ZMQ_UNSUBSCRIBE:
>
>         … some code …
>
>     default:
>
>         raise_exception (env, EINVAL);
>
>         return;
>
>     }
>
> }
>
>
>
> Removing this #if condition the setIdentity call works again with ZMQ 4.0.1.
>
>
>
> Cheers,
>
> Joel.
>
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>



More information about the zeromq-dev mailing list