[zeromq-dev] Regarding java binding of 0MQ.
gonzalo diethelm
gdiethelm at dcv.cl
Tue Nov 23 16:00:43 CET 2010
My answers:
#1: It was decided that all objects would be handled from the ZMQ class.
It's a design choice.
#2: You are right, this should be documented (as it is for the C
binding). But see #3.
#3: If we go this route, #2 would be moot. But the two behaviors are not
exactly the same. For Object, you specify a timeout of 0 if you want to
wait indefinitely, and -1 is illegal. For Poller, -1 means wait
indefinitely and 0 means "wait at most a very short time". We would also
have to define how to deprecate Poller.[gs]etTimeout(). Ideas?
#4: You are right, this is a dumb mistake on my part (probably because
of recent refactorings). I have changed them to public and pushed.
I await your (and anybody else's) comments on points 2 and 3. Thanks and
regards.
Gonzalo Diethelm
________________________________
From: zeromq-dev-bounces at lists.zeromq.org
[mailto:zeromq-dev-bounces at lists.zeromq.org] On Behalf Of SM
Sent: Monday, 22 November, 2010 19:17
To: zeromq-dev at lists.zeromq.org
Subject: [zeromq-dev] Regarding java binding of 0MQ.
Hi,
I am trying to use java binding of 0MQ. Following are my
questions/concerns regarding it (Note that before writing this I tried
to search mail archive for relevant discussions to insure I am not
repeating anything which is previously, but might have missed
something):
1. Why Socket/Poller/Context classes are the static inner classes? why
not make them independent classes?
2. When I tried to use Poller.poll() method, it was not doing blocking
call (which I thought would be default behavior) and was returning
immediately, after lot of digging (from Poller.cpp to zmq_poll
documentation) I found out that before calling Poller.poll() one should
set Poller.setTimeout() to -1 to wait indefinitely. This should have
been part of the javadoc of poll() method.
3. Instead of having only one Poller.poll() method why not have two
methods: 1. Poller.poll() with default behavior (to wait indefinitely),
and 2. Poller.poll(timeout) which waits for given time period. Much like
Object.wait() and Object.wait(timeout).
4. Poller.POLLIN/POLLOUT/POLLERR are private static final. How one can
use them in Poller.register (Socket socket, int events)?
---
SM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101123/226e4c69/attachment.htm>
More information about the zeromq-dev
mailing list