MulticastSocket GetTimeToLive() Example

returns the default time-to-live value


MulticastSocketclass GetTimeToLive() method example. This example shows you how to use GetTimeToLive() method.This method returns the default time-to-live value

Here is the code:-
/* 
 * @Program that Get the default time-to-live for multicast packets
 * GetTimeToLive.java 
 * Author:-RoseIndia Team
 * Date:-27-Jun-2008
 */

import java.net.*;

public class GetTimeToLive {
 public static void main(String[] argsthrows Exception {
        SocketAddress sa = new InetSocketAddress(8080);
        MulticastSocket ms = new MulticastSocket(sa);
        //Get the default time-to-live for multicast packets
        System.out.println("Default time-to-live is: "
                +ms.getTimeToLive());
    }
}

Output of the program:-
 Default time-to-live value is: 1

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US