Java MulticastSocket getTimeToLive()

getTimeToLive() is the method of MulticastSocket class. This method is used to get default time-to-live for the multicast packets which are sent out on the socket.

Syntax

Returns

It returns the default time-to-live value.

Throw

IOException ? This exception occurs while getting the default time-to-live value.

Example 1

Test it Now

Output:

Time to Live : 20

Example 2

Test it Now

Output:

Time to Live : 40




Latest Courses