Last active
October 16, 2017 04:11
radiodish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zsock_t *radio = zsock_new_radio ("inproc://zframe-test-radio"); | |
zsock_t *dish = zsock_new_dish ("inproc://zframe-test-radio"); | |
// Use following for multicast | |
// zsock_t *radio = zsock_new_radio ("udp://239.0.0.1:55555"); | |
// zsock_t *dish = zsock_new_dish ("udp://239.0.0.1:55555"); | |
// Join to group | |
rc = zsock_join (dish, "World"); | |
assert (rc == 0); | |
zframe_t *message = zframe_new ("Hello", 5); | |
rc = zframe_set_group (message, "World"); | |
assert (rc == 0); | |
rc = zframe_send (&message, radio, 0); | |
assert (rc == 0); | |
message = zframe_recv (dish); | |
assert (message); | |
assert (zframe_streq (message, "Hello")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very nice.
I tried to put the radio and dish in 2 programs and let them communicate over TCP.
When I start the radio first then the dish all works as expected.
When I start the dish first, the dish cannot be interrupted by ctlC until I start the radio.
I'm new to zmq so maybe I missed something.
I use ØMQ version 4.2.3 on a Ubuntu box
here my source code
TestRadio.c
TestDish.c