public void setNetworkInterface(NetworkInterface netIf)
        throws SocketException {

        synchronized (infLock) {
            getImpl().setOption(SocketOptions.IP_MULTICAST_IF2, netIf);
            infAddress = null;
            interfaceSet = true;
        }
    }
public void setNetworkInterface ( NetworkInterface netIf ) throws SocketException { synchronized ( infLock ) { getImpl ( ) . setOption ( SocketOptions . IP_MULTICAST_IF2 , netIf ) ; infAddress = null ; interfaceSet = true ; } }
Specify the network interface for outgoing multicast datagrams
sent on this socket.

@param netIf the interface
@exception SocketException if there is an error in
the underlying protocol, such as a TCP error.
@see #getNetworkInterface()
@since 1.4