v6Only property

bool v6Only
getter/setter pair

Indicates how an IPv6 bindAddress treats IPv4 addresses.

The default is false, which means it listens to any IPv4 and any IPv6 addresses.

If set to true, it only listens on any IPv6 address. That is, it will not listen on any IPv4 address.

This value has no effect if the bindAddress is not an IPv6 address or InternetAddress.anyIPv6. In particular, it has no effect when using InternetAddress.loopbackIPv6. Therefore, it is not possible to listen on both IPv4 and IPv6 loop-back addresses at the same time (not without also listening on every IPv4 and IPv6 address too).

Implementation

bool v6Only = false;