public void setNetworkInterface(NetworkInterface networkInterface) {
if (socket instanceof MulticastSocket) {
try {
((MulticastSocket) socket).setNetworkInterface(networkInterface);
} catch (SocketException e) {
throw new ChannelException(e);
}
} else {
throw new UnsupportedOperationException();
}
}