Other |
---|
tbdUnresolved |
Duplicate :
|
|
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
This issue came up on SO here: https://stackoverflow.com/questions/68769776/socketexception-when-calling-setnetworkinterface-on-a-multicastsocket-with-an-ip The environment is Windows with IPv6 enabled but disabled on a specific network interface, say "eth1". A DatagramChannel (or DatagramSocket or MulticastSocket) to an IPv6 socket is created. The setOption method is invoked to set the outgoing interface for multicast datagrams to be "eth1". The expectation is that it should succeed because it has IPv4 enabled but it fails because IPv6 is disabled. The issue can be worked by running with IPv6 disabled (-Djava.net.preferIPv4Stack=true). For DatagramChannel, the issue can be worked around by specifying the INET protocol family when creating the DatagramChannel. For MulticastSocket, the issue can be worked around in JDK 15 to 17 by running with the old DatagramSocketImpl (-Djdk.net.usePlainDatagramSocketImpl=true).
|