DatagramSocket GetTrafficClass() Example

Gets traffic class or type-of-service in the IP datagram header for packets sent from this DatagramSocket.


DatagramSocketclass GetTrafficClass() method example. This example shows you how to use GetTrafficClass() method.This method Gets traffic class or type-of-service in the IP datagram header for packets sent from this DatagramSocket.

Here is the code:-

/**
 * @Program that Gets traffic class or type-of-service in the IP datagram header
 * for packets sent from this DatagramSocket. 
 * GetTrafficClass.java 
 * Author:-RoseIndia Team
 * Date:-20-jun-2008
 */
import java.net.*;

public class GetTrafficClass {

    public static void main(String[] argsthrows Exception {
        DatagramSocket ds = new DatagramSocket();
        ds.connect(new InetSocketAddress(9090));
        System.out.println("The traffic class: " + ds.getTrafficClass());
              
    }
}

Output of the program:-
 The traffic class: 0

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

HOME | COPYRIGHT | CONTACT US