Minor changes

This commit is contained in:
Loic Guegan 2023-07-15 18:41:58 +02:00
parent 97c48bd23d
commit 644bd0f612
2 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,7 @@ int main (int argc, char *argv [])
void *subscriber = zmq_socket (context, ZMQ_SUB); void *subscriber = zmq_socket (context, ZMQ_SUB);
char bindto[30]; char bindto[30];
sprintf(bindto,"tcp://%s:%d",ip,port); sprintf(bindto,"tcp://%s:%d",ip,port);
int rc = zmq_connect (subscriber, bindto); int rc = zmq_bind (subscriber, bindto);
if(rc!=0){ if(rc!=0){
printf("Failed to bind zmq on %s\n",bindto); printf("Failed to bind zmq on %s\n",bindto);
exit(1); exit(1);

View file

@ -37,7 +37,7 @@ int main (int argc, char *argv [])
void *publisher = zmq_socket (context, ZMQ_PUB); void *publisher = zmq_socket (context, ZMQ_PUB);
char bindto[30]; char bindto[30];
sprintf(bindto,"tcp://%s:%d",__interface,__port); sprintf(bindto,"tcp://%s:%d",__interface,__port);
int rc = zmq_bind (publisher, bindto); int rc = zmq_connect (publisher, bindto);
if(rc!=0){ if(rc!=0){
printf("Failed to bind zmq on %s\n",bindto); printf("Failed to bind zmq on %s\n",bindto);
exit(1); exit(1);
@ -65,7 +65,7 @@ int main (int argc, char *argv [])
// Send current one // Send current one
if(FILE_EXISTS(logfile)){ if(FILE_EXISTS(logfile)){
publish(publisher,logfile,client,interval); publish(publisher,logfile,client,interval);
remove(logfile); //remove(logfile);
} }
} }
} }