Java MulticastSocket setInterface() Method

setInterface(InetAddress inf) is the method of MulticastSocket class. This method is used to set address of the network interface that is used for multicast packets.

Syntax

Parameter

inf - It is the InetAddress

Throw

SocketException - This exception occurs when there is error in the underlying protocol.

Example 1

Test it Now

Output:

Interface : /127.0.0.1




Latest Courses