[zeromq-dev] Problems with the Java Binding
Marko Mikulicic
marko.mikulicic at isti.cnr.it
Fri May 20 15:59:38 CEST 2011
On 20 May 2011 15:27, Attila-Mihaly Balazs <x_at_y_or_z at yahoo.com> wrote:
> Hello everyone,
>
> I'm playing around with ZMQ + Java and I've run into a couple of problems.
> The test program which I use is attached [1]. What I try to do:
> - start a published and a subscriber on a IPC transport (ipc://zeromq_test)
> - publish a message on this transport and ensure that I receive it back
> - stop the transport
>
> However I've run into several problems (which I suspect are caused by me,
> since I'm a ZMQ noob):
> - some times I get the message: "Assertion failed: nbytes == sizeof
> (command_t) (mailbox.cpp:245)" [4] - I found a discussion related to this
> from last year [3], however it's not clear to me what the problem is or how
> I should resolve it. Is this a bug or am I making a mistake?
> - some times the termination thread hangs. I've attached a gdb stack trace
> [2] with the termination thread. From it, if I read correctly, it hangs in
> mailbox.cpp:204, which is in recv (which has the blocking parameter set to
> true). Again, am I incorrectly terminating or is there a bug?
>
Hi,
Try initializing the sockets inside the thread that uses them and avoid
passing around sockets between threads.
See the attached modified version of your test.
Cheers,
Marko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110520/9b36b56d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestJZMQ.java
Type: text/x-java
Size: 3824 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110520/9b36b56d/attachment.java>
More information about the zeromq-dev
mailing list