[zeromq-dev] Need help in creating multiple publisher and subscribers

2012-08-22 Thread girish kumar
Hi All,

We have started recently working on zero MQ. We could able to run the
sample applications successfully.

We have two problems, which we are facing issues in getting answers.

1. We have a scenario where there are multiple publishers(threads) and
multiple subscribers(threads). We are not able to understand a model in
zero MQ, that works for this scenario.
  - As zero MQ sockets are not thread safe, can we make zero MQ sockets
threadsafe by applying explicit locks?.

2. Another problem is we are running some performance tests for best
results. We would like to know the highest possible numbers(latency and
throughput) achieved with zero MQ.

Any help in this regard is highly appreciated.


-- 
With Best Regards,
Girish
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Need help in creating multiple publisher and subscribers

2012-08-22 Thread Pieter Hintjens
On Wed, Aug 22, 2012 at 9:17 AM, girish kumar girishbanga...@gmail.com wrote:

 1. We have a scenario where there are multiple publishers(threads) and
 multiple subscribers(threads). We are not able to understand a model in zero
 MQ, that works for this scenario.

Bind the side that has the least less dynamic IP addresses, connect
the others to them.  If you really have a cloud of pubs and subs all
dynamically coming and going, use a device in the middle (forwarder)
with a known IP address.

   - As zero MQ sockets are not thread safe, can we make zero MQ sockets
 threadsafe by applying explicit locks?.

It's a bad idea from several aspects, leads to poor design and
unstable code. 0MQ sockets are not thread safe because well-designed
0MQ apps use messages to communicate, not locks.

 2. Another problem is we are running some performance tests for best
 results. We would like to know the highest possible numbers(latency and
 throughput) achieved with zero MQ.

You can use the performance tests in the perf/ subdirectory.

-Pieter
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] jeromq - java pojo zeromq

2012-08-22 Thread Min
Thank you for the information.

I changed the termination logic a little bit.

Please pull the latest code and test.

Thanks
Min

2012/8/22 Will Heger will.he...@gmail.com:
 Hi Min,

 Very thankful for this project.  To celebrate, here is an error report ;)


 ~/d $ git clone https://github.com/miniway/jeromq.git
 ~/d $ cd jeromq
 ~/d/jeromq $ mvn -X package
  Lots of Output ~~~
 Stop dealer B
 write header 6
 writer body
 30 30
 recv 6 OK end
 Stop client thread
 Exception in thread Thread-1001 java.lang.IllegalStateException
 at zmq.SocketBase.recv(SocketBase.java:769)
 at zmq.Device.device(Device.java:52)
 at zmq.ZMQ.zmq_device(ZMQ.java:335)
 at zmq.TestProxyTcp$Main.run(TestProxyTcp.java:274)

 Full debug output: http://pastebin.com/gYeZc9un

 Build env: Debian 64bit with Sun/Oracle Java 1.6

 Let me know if I can provide any more information or if you want me to post
 this to Github.

 Best regards and thanks for the effort,
 -Will


 On Tue, Aug 21, 2012 at 10:30 PM, ramesh chandra adroi...@gmail.com wrote:

 Thanks Min.

 regards,
 Ramesh


 On 08/21/2012 10:44 AM, Min Yu wrote:
  I'll state what is supporting and what is not in more detail. Actually
  the pgm is not supported also.
 
  I copy and paste c++ code then changed it into java by hand. The
  Eclipse help me a alot.
 
  Thanks
  Min
 
  Aug 21, 2012 9:31 PM Pieter Hintjens p...@imatix.com 작성:
 
  On Tue, Aug 21, 2012 at 1:23 PM, Min mini...@gmail.com wrote:
 
  99% means that we can send and recv between jeromq and the original
  zeromq through tcp.
 
  But Java doesn't support unix domain socket, so we cannot mix them for
  ipc.
  So I distracted 1%. Actually 90% compatible might have been the right
  value :)
  It's worth stating this clearly on the README, 100% compatible for
  tcp:// transport, does not support ipc://.
 
  Did you write all this by hand or did you have help from a C++-to-Java
  translator of some kind? It's impressive work either way.
 
  -Pieter
  ___
  zeromq-dev mailing list
  zeromq-dev@lists.zeromq.org
  http://lists.zeromq.org/mailman/listinfo/zeromq-dev
  ___
  zeromq-dev mailing list
  zeromq-dev@lists.zeromq.org
  http://lists.zeromq.org/mailman/listinfo/zeromq-dev

 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zeromq3-x test failing

2012-08-22 Thread Sebastian Lauwers
On 22/08/12 02:55, Mike Chesnut wrote:
 I'm trying to build from the latest git head of zeromq3-x.  When it
 gets to running 'make check', 1 of the 18 tests (test_shutdown_stress)
 fails with a segfault.

Indeed, I've noticed this behaviour as well, but assumed it was my 
compiler doing crazy things. I'm running a development version of clang.

The reason I thought so is because the issue is only reproducible when 
running with optimisations activated (-O1 or above, no -O flag or -O0 
works fine). This is the output of GDB with optimisations activated (-O1 
for no particular reason):

$ gdb tests/.libs/lt-test_shutdown_stress tests/core
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu.
For bug reporting instructions, please see:
http://bugs.launchpad.net/gdb-linaro/...
Reading symbols from 
/home/slau/src/foss/zeromq3-x/tests/.libs/lt-test_shutdown_stress...done.

warning: core file may not match specified executable file.
[New LWP 3315]
[New LWP 3334]
[New LWP 3316]
[New LWP 3318]
[New LWP 3317]
[New LWP 3313]
[New LWP 3312]
[New LWP 3319]
[New LWP 3293]
[New LWP 3331]
[New LWP 3314]
[New LWP 3332]
[New LWP 3328]
[New LWP 3327]
[New LWP ]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Core was generated by 
`/home/slau/src/foss/zeromq3-x/tests/.libs/lt-test_shutdown_stress'.
Program terminated with signal 11, Segmentation fault.
#0  0x2b2727ad53b8 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x2b2727ad53b8 in main_arena () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x2b27272c2db2 in zmq::ctx_t::monitor_event 
(this=0x2b2727ad5218, socket_=0x23f8260, event_=256, args_=optimized 
out) at ctx.cpp:405
#2  0x2b27272d6544 in zmq::socket_base_t::monitor_event 
(this=0x23f8260, event_=256, args=0x2b2728c89fd8) at socket_base.cpp:1006
#3  0x2b27272d47b6 in zmq::session_base_t::monitor_event 
(this=optimized out, event_=optimized out) at session_base.cpp:272
#4  0x2b27272dc3df in zmq::tcp_connecter_t::close 
(this=0x2b272c001ef0) at tcp_connecter.cpp:291
#5  0x2b27272dc776 in zmq::tcp_connecter_t::~tcp_connecter_t 
(this=0x2b272c001ef0, __in_chrg=optimized out) at tcp_connecter.cpp:77
#6  0x2b27272dc815 in zmq::tcp_connecter_t::~tcp_connecter_t 
(this=0x2b272c001ef0, __in_chrg=optimized out) at tcp_connecter.cpp:78
#7  0x2b27272cf38f in zmq::own_t::process_destroy (this=optimized 
out) at own.cpp:204
#8  0x2b27272cf9b1 in zmq::own_t::check_term_acks 
(this=0x2b272c001ef0) at own.cpp:198
#9  0x2b27272cfb1d in zmq::own_t::process_term (this=0x2b272c001ef0, 
linger_=0) at own.cpp:162
#10 0x2b27272cdde7 in zmq::object_t::process_command 
(this=0x2b272c001ef0, cmd_=optimized out) at object.cpp:112
#11 0x2b27272c8cc9 in zmq::io_thread_t::in_event (this=0x23f4110) at 
io_thread.cpp:82
#12 0x2b27272c7fde in zmq::epoll_t::loop (this=0x23f4380) at 
epoll.cpp:161
#13 0x2b27272c8031 in zmq::epoll_t::worker_routine (arg_=optimized 
out) at epoll.cpp:174
#14 0x2b27272dd361 in thread_routine (arg_=0x23f43f0) at thread.cpp:83
#15 0x2b2727522efc in start_thread (arg=0x2b2728c8b700) at 
pthread_create.c:304
#16 0x2b272781c59d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#17 0x in ?? ()
(gdb)

FYI, this is built from zeromq3-x, commit 7879cc9.

Also, note that this is the same segfault that Arkady Rost reported back 
in July:
http://lists.zeromq.org/pipermail/zeromq-dev/2012-July/017911.html

However, only the segfault in test_monitor, was fixed:
http://lists.zeromq.org/pipermail/zeromq-dev/2012-August/017985.html

HTH,

-S.
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] jeromq - java pojo zeromq

2012-08-22 Thread jonas . adler
Hello!

Let me first say that this is awesome, and I really love the amount of
work you have put into this!

However! I cannot get it to work on windows :(

I try using this bit of code:

public class TestZMQ {

public static void main(String[] args) {
// Prepare our context and subscriber
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket subscriber = context.socket(ZMQ.SUB);

// Connect to server
subscriber.connect(tcp://localhost:5563);
while (true) {
// Read envelope with address
String address = new String(subscriber.recv(0));
// Read message contents
String contents = new String(subscriber.recv(0));
System.out.println(address +  :  + contents);
}
}
}

but the program hangs on subscriber.recv(0)!

Following the call stack i see that the program gets stuck on:

Signaler.wait_event(long) line:108

which calls:

WindowsSelectorImpl(SelectorImpl).selectNow()

Anyone else has this issue? Or any idea on how to solve it? I have tried
some debugging, and i know that on a TCP level, i am connected to the
server...

 Hello

 I'm happy to announce that I've built a jeromq with POJO based on
 zeromq-3x c++ sources.

 https://github.com/miniway/jeromq

 The primary purpose of the work was to understand deeply how zeromq works.
 I've got lots of insight and learned a lot from zeromq internals.

 It's in a very early stage and it must have bugs and issues. But I
 hope this project help someone who only know java to understand
 zeromq.

 Thanks
 Min
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Need help in creating multiple publisher and subscribers

2012-08-22 Thread Chuck Remes
On Aug 22, 2012, at 2:17 AM, girish kumar wrote:

 Hi All,
 
 We have started recently working on zero MQ. We could able to run the sample 
 applications successfully. 
 
 We have two problems, which we are facing issues in getting answers.
 
 1. We have a scenario where there are multiple publishers(threads) and 
 multiple subscribers(threads). We are not able to understand a model in zero 
 MQ, that works for this scenario. 
   - As zero MQ sockets are not thread safe, can we make zero MQ sockets 
 threadsafe by applying explicit locks?.

Each publisher thread should have its own socket. Each subscriber thread should 
also have its own socket. Create a single context and share it amongst all of 
your threads and create the sockets when the thread spins up. The library uses 
lockfree algos internally so if you decide to share a single pub/sub socket 
amongst several threads, the lock contention in your application code will kill 
performance. Let the library do the hard work since it is already optimized for 
this purpose.

 2. Another problem is we are running some performance tests for best results. 
 We would like to know the highest possible numbers(latency and throughput) 
 achieved with zero MQ.

Use the tests in the perf/ subdirectory on the hardware you will be using. 
Latency and throughput are extremely sensitive to CPU speeds, bus speeds, 
network speeds and other hardware characteristics. Any numbers that I could 
quote you would be specific to my environment and therefore useless to you.

cr

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] jeromq - java pojo zeromq

2012-08-22 Thread Min
Hello,

If you don't set SUBSCRIBE, sub socket will block.

please add the following line before connect.

subscriber.subscribe()  // please pull the latest source first

Thanks
Min

2012/8/22  jonas.ad...@epiq.se:
 Hello!

 Let me first say that this is awesome, and I really love the amount of
 work you have put into this!

 However! I cannot get it to work on windows :(

 I try using this bit of code:

 public class TestZMQ {

 public static void main(String[] args) {
 // Prepare our context and subscriber
 ZMQ.Context context = ZMQ.context(1);
 ZMQ.Socket subscriber = context.socket(ZMQ.SUB);

 // Connect to server
 subscriber.connect(tcp://localhost:5563);
 while (true) {
 // Read envelope with address
 String address = new String(subscriber.recv(0));
 // Read message contents
 String contents = new String(subscriber.recv(0));
 System.out.println(address +  :  + contents);
 }
 }
 }

 but the program hangs on subscriber.recv(0)!

 Following the call stack i see that the program gets stuck on:

 Signaler.wait_event(long) line:108

 which calls:

 WindowsSelectorImpl(SelectorImpl).selectNow()

 Anyone else has this issue? Or any idea on how to solve it? I have tried
 some debugging, and i know that on a TCP level, i am connected to the
 server...

 Hello

 I'm happy to announce that I've built a jeromq with POJO based on
 zeromq-3x c++ sources.

 https://github.com/miniway/jeromq

 The primary purpose of the work was to understand deeply how zeromq works.
 I've got lots of insight and learned a lot from zeromq internals.

 It's in a very early stage and it must have bugs and issues. But I
 hope this project help someone who only know java to understand
 zeromq.

 Thanks
 Min
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Need help in creating multiple publisher and subscribers

2012-08-22 Thread girish kumar
Thanks for your reply.

Can you give more details of how multi-threaded publisher and subscriber
works. I am new to zero MQ and I feel difficulty in understanding your
solution.

Bind the side that has the least less dynamic IP addresses, connect
the others to them.  If you really have a cloud of pubs and subs all
dynamically coming and going, use a device in the middle (forwarder)
with a known IP address.

If any pre-material needed in understanding this solution, that will be
helpful.


On 22 August 2012 12:47, girish kumar girishbanga...@gmail.com wrote:

 Hi All,

 We have started recently working on zero MQ. We could able to run the
 sample applications successfully.

 We have two problems, which we are facing issues in getting answers.

 1. We have a scenario where there are multiple publishers(threads) and
 multiple subscribers(threads). We are not able to understand a model in
 zero MQ, that works for this scenario.
   - As zero MQ sockets are not thread safe, can we make zero MQ sockets
 threadsafe by applying explicit locks?.

 2. Another problem is we are running some performance tests for best
 results. We would like to know the highest possible numbers(latency and
 throughput) achieved with zero MQ.

 Any help in this regard is highly appreciated.


 --
 With Best Regards,
 Girish




-- 
With Best Regards,
Girish
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] Need help in creating multiple publisher and subscribers

2012-08-22 Thread Michel Pelletier
It's all in the guide Girish:

http://zguide.zeromq.org/page:all#A-Publish-Subscribe-Proxy-Server

Have the forwarder bind on both sides and the pubs and subs connect to it.

-Michel

On Wed, Aug 22, 2012 at 5:24 AM, girish kumar girishbanga...@gmail.com wrote:
 Thanks for your reply.

 Can you give more details of how multi-threaded publisher and subscriber
 works. I am new to zero MQ and I feel difficulty in understanding your
 solution.

 Bind the side that has the least less dynamic IP addresses, connect
 the others to them.  If you really have a cloud of pubs and subs all
 dynamically coming and going, use a device in the middle (forwarder)
 with a known IP address.

 If any pre-material needed in understanding this solution, that will be
 helpful.


 On 22 August 2012 12:47, girish kumar girishbanga...@gmail.com wrote:

 Hi All,

 We have started recently working on zero MQ. We could able to run the
 sample applications successfully.

 We have two problems, which we are facing issues in getting answers.

 1. We have a scenario where there are multiple publishers(threads) and
 multiple subscribers(threads). We are not able to understand a model in zero
 MQ, that works for this scenario.
   - As zero MQ sockets are not thread safe, can we make zero MQ sockets
 threadsafe by applying explicit locks?.

 2. Another problem is we are running some performance tests for best
 results. We would like to know the highest possible numbers(latency and
 throughput) achieved with zero MQ.

 Any help in this regard is highly appreciated.


 --
 With Best Regards,
 Girish




 --
 With Best Regards,
 Girish


 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] jeromq - java pojo zeromq

2012-08-22 Thread Jeff Rodenburg
Thanks Min. Can you contrast the differences between this lib wrapper and
jzmq? I can perceive some of those, but would prefer to hear your thoughts.

thanks,
Jeff





On Tue, Aug 21, 2012 at 12:22 AM, Min mini...@gmail.com wrote:

 Hello

 I'm happy to announce that I've built a jeromq with POJO based on
 zeromq-3x c++ sources.

 https://github.com/miniway/jeromq

 The primary purpose of the work was to understand deeply how zeromq works.
 I've got lots of insight and learned a lot from zeromq internals.

 It's in a very early stage and it must have bugs and issues. But I
 hope this project help someone who only know java to understand
 zeromq.

 Thanks
 Min
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zeromq3-x test failing

2012-08-22 Thread Mike Chesnut
On Wed, Aug 22, 2012 at 1:50 AM, Sebastian Lauwers
sebastian.lauw...@gmail.com wrote:
 On 22/08/12 02:55, Mike Chesnut wrote:
 I'm trying to build from the latest git head of zeromq3-x.  When it
 gets to running 'make check', 1 of the 18 tests (test_shutdown_stress)
 fails with a segfault.

 Indeed, I've noticed this behaviour as well, but assumed it was my
 compiler doing crazy things. I'm running a development version of clang.

 The reason I thought so is because the issue is only reproducible when
 running with optimisations activated (-O1 or above, no -O flag or -O0
 works fine).

Thanks for the info, this is very interesting.  Unfortunately in my
environment the segfault still occurs no matter which level of
optimization I use (I've tried -O2, -O1, and -O0 now).

Is there further information I can provide to help in debugging this?

Thanks,
Mike
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] jeromq - java pojo zeromq

2012-08-22 Thread Will Heger
Hi Min,

The fixed project is building now and testing.  I get two test failures
right now:

 *  zmq.TestConnectResolve
 *  zmq.TestAddress

http://pastebin.com/LUcyuGFX

Otherwise looks good.

Best regards,
-Will




On Wed, Aug 22, 2012 at 1:17 PM, Jeff Rodenburg jeff.rodenb...@gmail.comwrote:

 Thanks Min. Can you contrast the differences between this lib wrapper and
 jzmq? I can perceive some of those, but would prefer to hear your thoughts.

 thanks,
 Jeff





 On Tue, Aug 21, 2012 at 12:22 AM, Min mini...@gmail.com wrote:

 Hello

 I'm happy to announce that I've built a jeromq with POJO based on
 zeromq-3x c++ sources.

 https://github.com/miniway/jeromq

 The primary purpose of the work was to understand deeply how zeromq works.
 I've got lots of insight and learned a lot from zeromq internals.

 It's in a very early stage and it must have bugs and issues. But I
 hope this project help someone who only know java to understand
 zeromq.

 Thanks
 Min
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev


___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] OpenPGM 5.1.121 - fixes and fixes

2012-08-22 Thread Steven McCoy
I'm rolling with minor fixes and only relative enhancement is OS X 10.7/8
support.  Probably suitable for updating both 2.x and 3.x trees at some
point.

No binaries and only a DFSG package currently.

https://code.google.com/p/openpgm/downloads/detail?name=libpgm-5.2.121~dfsg.tar.gzcan=2q=

-- 
Steve-o
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] jeromq - java pojo zeromq

2012-08-22 Thread Min
Jeff,

I'm trying to make jzmq and jeromq as compatible as possible but
package namespace. On that strategy, missing methods will be added
soon and should work exactly same with jzmq, then I'll just add some
sugar methods and classes.

I don't want to surprise anyone who is already familiar with jzmq.


Will,

The test failures are known problem. I get same failure at home but
not at office. Some ISP, including my home's ISP, responds a default
ip address for not existing domain. It might seems that ISP let user
redirect to their commercial site.

Anyway, I'm going to ignore the test as it is a very trivial case.

Thanks
Min

2012/8/23 Will Heger will.he...@gmail.com:
 Hi Min,

 The fixed project is building now and testing.  I get two test failures
 right now:

  *  zmq.TestConnectResolve
  *  zmq.TestAddress

 http://pastebin.com/LUcyuGFX

 Otherwise looks good.

 Best regards,
 -Will





 On Wed, Aug 22, 2012 at 1:17 PM, Jeff Rodenburg jeff.rodenb...@gmail.com
 wrote:

 Thanks Min. Can you contrast the differences between this lib wrapper and
 jzmq? I can perceive some of those, but would prefer to hear your thoughts.

 thanks,
 Jeff





 On Tue, Aug 21, 2012 at 12:22 AM, Min mini...@gmail.com wrote:

 Hello

 I'm happy to announce that I've built a jeromq with POJO based on
 zeromq-3x c++ sources.

 https://github.com/miniway/jeromq

 The primary purpose of the work was to understand deeply how zeromq
 works.
 I've got lots of insight and learned a lot from zeromq internals.

 It's in a very early stage and it must have bugs and issues. But I
 hope this project help someone who only know java to understand
 zeromq.

 Thanks
 Min
 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev



 ___
 zeromq-dev mailing list
 zeromq-dev@lists.zeromq.org
 http://lists.zeromq.org/mailman/listinfo/zeromq-dev

___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


[zeromq-dev] zmq_send blocks after zmq_bind and before other side connects

2012-08-22 Thread Dmitrijs Palcikovs
It seems like zmq_send blocks after zmq_bind and before the other side
connects to the endpoint.
For example, the following code:

void *sock = zmq_socket(ctx, ZMQ_PAIR);
zmq_bind(sock, tcp://*:9090);
zmq_msg_t msg;
zmq_msg_init_size(msg, 5);
memcpy(zmq_msg_data(msg), hello, 5);
zmq_send(sock, msg);  // Blocks until someone connects
zmq_msg_close(msg)

If zmq_bind is replaced with zmq_connect then it doesn't block. I would
expect zmq_send to buffer outgoing messages in both scenarios (bind and
connect). This behavior doesn't seem to be documented anywhere (i.e. most
of the docs seem to give the impression that bind and connect are similar
in this sense), yet this is a significant difference between the two. Can
anyone comment on why this is the behavior for bind?
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Re: [zeromq-dev] zmq_send blocks after zmq_bind and before other side connects

2012-08-22 Thread Justin Karneges
On Wednesday, August 22, 2012 10:30:55 PM Dmitrijs Palcikovs wrote:
 It seems like zmq_send blocks after zmq_bind and before the other side
 connects to the endpoint.
 For example, the following code:
 
 void *sock = zmq_socket(ctx, ZMQ_PAIR);
 zmq_bind(sock, tcp://*:9090);
 zmq_msg_t msg;
 zmq_msg_init_size(msg, 5);
 memcpy(zmq_msg_data(msg), hello, 5);
 zmq_send(sock, msg);  // Blocks until someone connects
 zmq_msg_close(msg)
 
 If zmq_bind is replaced with zmq_connect then it doesn't block. I would
 expect zmq_send to buffer outgoing messages in both scenarios (bind and
 connect). This behavior doesn't seem to be documented anywhere (i.e. most
 of the docs seem to give the impression that bind and connect are similar
 in this sense), yet this is a significant difference between the two. Can
 anyone comment on why this is the behavior for bind?

This is a non-obvious behavior of zeromq that I ran into as well. It was added 
to the FAQ: http://www.zeromq.org/area:faq
Why do I see different behavior when I bind a socket versus connect a socket?

Justin
___
zeromq-dev mailing list
zeromq-dev@lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev