mirror of
https://gitlab.com/manzerbredes/ina260-zmq-publisher.git
synced 2025-04-07 04:16:26 +02:00
Minor changes
This commit is contained in:
parent
97c48bd23d
commit
644bd0f612
2 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue