Java MulticastSocket getInterface()

getInterface() is the method of MulticastSocket class. This method is used to get address of the network interface that is used for multicast packets.

Syntax

Returns

It returns an address of the network interface.

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