[zeromq-dev] zmq addressing?

Martin Sustrik sustrik at fastmq.com
Fri May 23 17:48:04 CEST 2008


Hi Randy,

As for version 0.2 you have to supply IP address and port manually.

With version 0.3 you'll have directory service that'll do the lookup for 
you. You can download it from the SVN 
(http://svn.fastmq.org/svn/zeromq/branches/refactoring-for-0.3), 
however, it is still under development, so you would have to deal with 
constant changes of the codebase :(

My suggestion would be to stick with 0.2 at the moment and wait for 0.3 
to be delivered (June 2008).

With version 0.2 setup of the connection looks something like this:

     dispatcher_t dispatcher (2);
     api_engine_t api (&dispatcher);  //  thread 0
     bp_engine_t bp (&dispatcher, false, "127.0.0.1", 5555, 0, 0, 8192, 
8192);
     poll_thread_t poll_thread (&bp); //  thread 1

where

false = don't listen, connect actively to the peer instead
"127.0.0.1" = IP address to connect to
5555 = port to connect to
0,0 = thread to communicate with (client thread)
8192, 8192 = batching size for in & out network traffic

Hope this helps.
Martin

Randy MacLeod wrote:
> Hi,
> 
> I just downloaded zmq-0.2.
> I've compiled it, ran make check and looked at the test code.
> Looks nice and simple from the outside.
> What I don't see is a multi-process/distributed example.
> I'd like to know what your addressing scheme is for this case : IP, port?
> How do zmp processes find each other?
> 
> I started digging into the implementation but I don't have
> that much time....
> 
> Thanks,




More information about the zeromq-dev mailing list