[nanomsg] Re: Getting rid of the old IPV4ONLY socket option semantics

  • From: Martin Sustrik <sustrik@xxxxxxxxxx>
  • To: nanomsg@xxxxxxxxxxxxx
  • Date: Tue, 10 Sep 2013 12:51:20 +0200

Hi Mark,

Thanks for the detailed disussion of the topic.

It seems the most widely used solution is to turn the IPV6_V6ONLY on
(or just leave it enabled), and use separate sockets for each protocol
family: apache, bind, unbound, powerdns, ntpd, postfix, ...

To be able to listen (bind) on multiple interfaces on a multihomed
host, it would be necessary to have multiple sockets and use a select()
on them anyway, regardless of their protocol family.

Just to double check: What you are saying is that due to inconsistencies between different OSes, the only reliable way to support both IPv4 and IPv6 incoming connections is to bind one socket to the IPv4 address and another one to the IPv6 address. Right?

Any special guidelines to avoid EADDRINUSE errors in such setup?

Btw, it is already possible to bind nanomsg socket to multiple endpoints:

s = nn_socket (AF_SP, NN_PUB);
nn_bind (s, "tcp://127.0.0.1:5555");
nn_bind (s, "tcp://[::1]:5555");

so implementing that kind of thing should be fairly trivial.

Martin

Other related posts: