Add print statements for debugging
This commit is contained in:
@@ -101,6 +101,7 @@ static void *worker_task(zsock_t *pipe, char *disk_path) {
|
|||||||
// Process message
|
// Process message
|
||||||
|
|
||||||
// do something here
|
// do something here
|
||||||
|
printf("Received a message in the worker\n");
|
||||||
|
|
||||||
// Sending reply
|
// Sending reply
|
||||||
zmsg_send(&msg, pipe);
|
zmsg_send(&msg, pipe);
|
||||||
@@ -128,16 +129,18 @@ int main(int argc, char **argv) {
|
|||||||
for (int i = 0; i < worker_count; i++) {
|
for (int i = 0; i < worker_count; i++) {
|
||||||
char *path = strtok(argv[i+1], ":");
|
char *path = strtok(argv[i+1], ":");
|
||||||
worker_map[i].name = strtok(NULL, ":");
|
worker_map[i].name = strtok(NULL, ":");
|
||||||
|
printf("name: %s\n", worker_map[i].name);
|
||||||
worker_map[i].worker = zactor_new(worker_task, path);
|
worker_map[i].worker = zactor_new(worker_task, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *ep = endpoint();
|
char *ep = endpoint();
|
||||||
|
printf("ep: %s\n", ep);
|
||||||
zsock_t *frontend = zsock_new_router(ep);
|
zsock_t *frontend = zsock_new_router(ep);
|
||||||
free(ep);
|
free(ep);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
zmsg_t *msg = zmsg_recv(frontend);
|
zmsg_t *msg = zmsg_recv(frontend);
|
||||||
|
printf("Received a message in the router\n");
|
||||||
if (!msg) break;
|
if (!msg) break;
|
||||||
|
|
||||||
// Find the worker with the given name.
|
// Find the worker with the given name.
|
||||||
|
|||||||
Reference in New Issue
Block a user