Minor changes

This commit is contained in:
Loic Guegan 2023-07-14 20:08:36 +02:00
parent e0440fc811
commit 5f4d586aca
7 changed files with 35 additions and 21 deletions

View file

@ -6,12 +6,8 @@
#include <time.h>
#include <string.h>
#define STR(symbol) #symbol
#define STRINGIFY(symbol) STR(symbol)
#include "../utils.h"
#ifndef PUBLISHER_PORT
#error PUBLISHER_PORT macro undefined
#endif
int main (int argc, char *argv [])
{
@ -19,7 +15,7 @@ int main (int argc, char *argv [])
printf ("Collecting updates from weather server...\n");
void *context = zmq_ctx_new ();
void *subscriber = zmq_socket (context, ZMQ_SUB);
int rc = zmq_connect (subscriber, "tcp://localhost:"STRINGIFY(PUBLISHER_PORT));
int rc = zmq_connect (subscriber, "tcp://"STRINGIFY(PUBLISHER_ADDR)":"STRINGIFY(PUBLISHER_PORT));
assert (rc == 0);
// Subscribe to zipcode, default is NYC, 10001