Quantcast
Channel: Active questions tagged zeromq - Stack Overflow
Viewing all articles
Browse latest Browse all 235

How do I specify an IPv6 address for a ZeroMQ REQ/REP setup on a local machine?

$
0
0

I cannot get a zmq server and client to talk with IPv6, while it easily works with IPv4 with C++.

This is what the ip addr command shows:

2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 1c:1b:0d:0c:d7:bc brd ff:ff:ff:ff:ff:ffinet 192.168.35.208/24 brd 192.168.35.255 scope global dynamic enp0s31f6   valid_lft 7193sec preferred_lft 7193secinet6 fe80::fb7:c6df:9d3a:3d7b/64 scope link   valid_lft forever preferred_lft forever

Server:

zmq::context_t context(1);zmq::socket_t server(context, ZMQ_REP);server.setsockopt(ZMQ_IPV6, 1);server.bind("tcp://*:5555%enp0s31f6");

Client:

zmq::context_t context(1);zmq::socket_t client(context, ZMQ_REQ);client.setsockopt(ZMQ_IPV6, 1);client.connect("tcp://[fe80::fb7:c6df:9d3a:3d7b]:5555%enp0s31f6");

The server waits listening, the clients sends the message, the server never gets it. IPv4 works nicely.

What is wrong?


Viewing all articles
Browse latest Browse all 235

Trending Articles