[zeromq-dev] Using zmq over network without zmq_server
Martin Sustrik
sustrik at fastmq.com
Mon Jun 8 09:29:37 CEST 2009
Hi Ville
> We have a server in a known location with a global exchange. We would like to
> access the server without having to use zmq_server. Now, if we were using the
> C++ API we could use dummy_locator_t[1] and be done with it, but we are using
> the C API, and we'd rather not maintain a private fork of libczmq.
>
> So, is there any plans to include dummy_locator_t or something like that to the
> mainline, and to expose it via the C API?
>
> As a concrete example of what I mean, I've attached a patch for libczmq
> that we've been playing around with. The patch is against 0.6.1 and is
> released under MIT license.
What we are working on at the moment is an alternate API to access 0MQ
functionality. Specifically, it's API using "socket" metaphor rather
than "exchange/queue" metaphor. One of the consequences is that you are
using concrete addresses of network nodes rather than symbolic names:
void *context = zs_init (1, 1);
void *s = zs_socket (context, ZS_PUBLISHER);
zs_connect ("192.168.0.115:5555", NULL);
zs_msg msg;
zs_msg_init_size (&msg, 10);
memset (zs_msg_data (&msg), 0, 10);
zs_send (s, &msg);
...
Have a look at the the API definition here:
http://svn.fastmq.org/svn/zsock/trunk/include/zsockets.h
Any comments and/or suggestions are welcome.
Martin
More information about the zeromq-dev
mailing list