[zeromq-dev] zmq_device

Jon Dyte jon at totient.co.uk
Thu Apr 1 23:57:28 CEST 2010


Hi Martin/ Gonzalo/ Brian

As part of the discussion on the list to provide a c api zmq_device so 
that you could do this :-

int main()
{
  void * ctx = zmq_init(1,1,0);
  void *ear = zmq_socket (ctx, ZMQ_SUB);
  zmq_bind (ear, "tcp://lo:5001");
  zmq_setsockopt (ear, ZMQ_SUBSCRIBE, "forex.", 6);
  void *mouth = zmq_socket (ctx, ZMQ_PUB);
  zmq_connect (ear, "tcp://127.0.0.1:5001");
  zmq_device (ZMQ_FORWARDER, ear, mouth);
}

Please find attached a first cut of this.

There is also a C++ class called device_t which can be used in the C++ 
space.

It should apply cleanly to the trunk, but needs a few formatting edits 
to get it into zmq style.
(I'm also considering renaming some of the classes as they are a bit long)
(Incidently does any one have a zmq-c-style for emacs?)

It needs testing, so if anyone has a chance, please do.
I am posting it up now so as to get it reviewed.

Thanks

Jon

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-initial-commit-of-devices.patch
Type: text/x-patch
Size: 11920 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-removed-use-of-zmq-message_t-in-devices-replaced-wit.patch
Type: text/x-patch
Size: 5679 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-added-copyright-and-ifdef-guards-to-device-header-fi.patch
Type: text/x-patch
Size: 10370 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-alphabetical-order-in-automake-file.patch
Type: text/x-patch
Size: 3454 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-make-prebuilt-devices-use-the-new-zmq-device_t.patch
Type: text/x-patch
Size: 4761 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-fix-ignore-file.patch
Type: text/x-patch
Size: 484 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-fixed-typo.patch
Type: text/x-patch
Size: 732 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100401/60999706/attachment-0006.bin>


More information about the zeromq-dev mailing list