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[] args) throws Exception {
DatagramSocket ds = new DatagramSocket();
ds.connect(new InetSocketAddress(9090));
System.out.println("The traffic class: " + ds.getTrafficClass());
}
} |
|