mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
zeromq: added IPv6 options
This commit is contained in:
parent
9edd0fc68d
commit
5ef08552b2
2 changed files with 13 additions and 0 deletions
|
@ -33,6 +33,8 @@
|
|||
#include "list.h"
|
||||
|
||||
struct zeromq {
|
||||
int ipv6;
|
||||
|
||||
enum {
|
||||
ZEROMQ_PATTERN_PUBSUB,
|
||||
ZEROMQ_PATTERN_RADIODISH
|
||||
|
|
|
@ -84,6 +84,9 @@ int zeromq_parse(struct node *n, config_setting_t *cfg)
|
|||
else
|
||||
cerror(cfg, "Invalid type for ZeroMQ node: %s", node_name_short(n));
|
||||
}
|
||||
|
||||
if (!config_setting_lookup_bool(cfg, "ipv6", &z->ipv6))
|
||||
z->ipv6 = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -141,10 +144,18 @@ int zeromq_start(struct node *n)
|
|||
z->publisher.socket = zmq_socket(context, ZMQ_PUB);
|
||||
break;
|
||||
}
|
||||
|
||||
ret = zmq_setsockopt(z->publisher.socket, &z->ipv6, sizeof(z->ipv6));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Bind subscriber socket */
|
||||
if (z->subscriber.endpoint) {
|
||||
ret = zmq_bind(z->subscriber.socket, z->subscriber.endpoint);
|
||||
ret = zmq_setsockopt(z->subscriber.socket, &z->ipv6, sizeof(z->ipv6));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue