diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-14 19:29:18 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-07-14 19:29:18 +0200 |
| commit | 6172ad70924be37de833facb41365eff1cec497b (patch) | |
| tree | b915b78a055ef25cf1d9585f00eb369aa268a41d /src/client | |
| parent | 2e02fd6b93606656d04e31e4c351d9658dd41f0a (diff) | |
Minor changes
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/Makefile | 2 | ||||
| -rw-r--r-- | src/client/main.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/client/Makefile b/src/client/Makefile index d370439..0ae633e 100644 --- a/src/client/Makefile +++ b/src/client/Makefile @@ -1,5 +1,5 @@ EXEC=client -CFLAGS=-lzmq +CFLAGS+=-lzmq all: main.c $(CC) $^ -o $(OUT)/$(EXEC) $(CFLAGS) diff --git a/src/client/main.c b/src/client/main.c index 5204ae3..e7ff4a5 100644 --- a/src/client/main.c +++ b/src/client/main.c @@ -6,13 +6,20 @@ #include <time.h> #include <string.h> +#define STR(symbol) #symbol +#define STRINGIFY(symbol) STR(symbol) + +#ifndef PUBLISHER_PORT +#error PUBLISHER_PORT macro undefined +#endif + int main (int argc, char *argv []) { // Socket to talk to server 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:5556"); + int rc = zmq_connect (subscriber, "tcp://localhost:"STRINGIFY(PUBLISHER_PORT)); assert (rc == 0); // Subscribe to zipcode, default is NYC, 10001 |
