From 2e02fd6b93606656d04e31e4c351d9658dd41f0a Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 14 Jul 2023 18:49:03 +0200 Subject: Minor changes --- src/publisher/main.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/publisher/main.c') diff --git a/src/publisher/main.c b/src/publisher/main.c index 6ff8ae1..0abfefb 100644 --- a/src/publisher/main.c +++ b/src/publisher/main.c @@ -1,7 +1,25 @@ +// Weather update server +// Binds PUB socket to tcp://*:5556 +// Publishes random weather updates +#include +#include +#include +int main (void) +{ + // Prepare our context and publisher + void *context = zmq_ctx_new (); + void *publisher = zmq_socket (context, ZMQ_PUB); + int rc = zmq_bind (publisher, "tcp://*:5556"); + assert (rc == 0); -int main(){ - - return 0; -} + // Initialize random number generator + while (1) { + zmq_send (publisher, "Hello World", 5, 0); + printf("AA\n"); + } + zmq_close (publisher); + zmq_ctx_destroy (context); + return 0; +} \ No newline at end of file -- cgit v1.2.3