Java MulticastSocket getNetworkInterface()

Last Updated : 17 Mar 2025

getNetworkInterface() is the method of MulticastSocket class. This method is used to set the multicast interface.

Syntax

Returns

It returns the multicast NetworkInterface currently set.

Throw

SocketException - this exception occurs in the underlying protocol

Example 1

Output:

Network Inteface : name:lo (Software Loopback Interface 1)