[zeromq-dev] Java/Windows issues

Robin Weisberg robin at scout-trading.com
Tue Aug 4 19:29:27 CEST 2009


Thanks Martin!

FYI, I noticed that when running the same listener app under linux
restarting the publisher doesn't cause a problem. So it seems its windows
related not java related.

BTW is there a good reason for not being able to have multiple listeners
listening on the same machine? Even when I run w/ udp encapsulation I can't
have multiple apps running listening to the same multicast address. From a
high level it would seem to me it should be as simple as just setting the
appropriate socket option

setsockopt(_socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)

But I guess there could be more going on underneath the hood. Let me know if
this is a more appropriate question for the OpenPGM folks.


On Tue, Aug 4, 2009 at 8:49 AM, Martin Sustrik <sustrik at fastmq.com> wrote:

> Hi Robin,
>
>  Hi folks. As I've been using 0mq a bit more I've run into a few issues:
>> 1 - the mask(Zmq.MESSAGE_GAP) method in Java throws an exception on
>> Windows. Looking at the Java perf examples I don't see this method being
>> called. Any reason this isn't implemented? Its in the Zmq class interface.
>> When I comment out this call to mask the application functions fine. The
>> exception is:
>>
>> Exception in thread "main" java.lang.UnsatisfiedLinkError:
>> org.zmq.Zmq.mask(I)V
>>    at org.zmq.Zmq.mask(Native Method)
>>    at com.st.common.Messaging.<init>(Messaging.java:44)
>>    at com.st.common.Messaging.<clinit>(Messaging.java:20)
>>    at com.st.gui.ScoutGUI.main(ScoutGUI.java:80)
>>
>
> Ok, there's incorrect prototype for the implementation of the mask
> function. Following patch should help:
>
> Index: libjzmq/Zmq.cpp
> ===================================================================
> --- libjzmq/Zmq.cpp     (revision 1603)
> +++ libjzmq/Zmq.cpp     (working copy)
> @@ -111,7 +111,7 @@
>  }
>
>  JNIEXPORT void JNICALL Java_org_zmq_Zmq_mask (JNIEnv *env, jobject obj,
> -    int notifications)
> +    jint notifications)
>  {
>     //  Get the context.
>     context_t *context = (context_t*) env->GetLongField (obj, context_fid);
>
>  2 - I have a linux c++ publisher publishing using pgm to multiple java
>> windows clients. The linux client is registering a global exchange and the
>> windows clients register a local queue to that exchange. It appears that
>> after restarting the linux publisher the windows client stops receiving
>> messages until it is also restarted.
>>
>
> Rastart of PGM publisher on win/linux seemed to work when we've did 1.0.0
> tests. We'll have a look at the scenario shortly.
>
> Martin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20090804/8293c63b/attachment.htm>


More information about the zeromq-dev mailing list