MulticastSocket GetTTL() Example

returns the default time-to-live value


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

Here is the code:-
/* 
 * @Program that Returns the default time-to-live value 
 * GetTTL.java 
 * Author:-RoseIndia Team
 * Date:-27-Jun-2008
 */

import java.net.*;

public class GetTTL {

    public static void main(String[] argsthrows Exception {
        SocketAddress sa = new InetSocketAddress(8080);
        MulticastSocket ms = new MulticastSocket(sa);
        // Returns the default time-to-live value 
        byte b=ms.getTTL();
        System.out.println("Default time-to-live value is: "+b);
    }
}

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