List of usage examples for java.net Socket getTrafficClass
public int getTrafficClass() throws SocketException
As the underlying network implementation may ignore the traffic class or type-of-service set using #setTrafficClass(int) this method may return a different value than was previously set using the #setTrafficClass(int) method on this Socket.
From source file:Main.java
License:asdf
public static void main(String args[]) throws Exception { Socket s = new Socket("internic.net", 43); InputStream in = s.getInputStream(); OutputStream out = s.getOutputStream(); String str = "asdfasdfasdf\n"; byte buf[] = str.getBytes(); out.write(buf);/*w ww . j a v a2s.com*/ int c; while ((c = in.read()) != -1) { System.out.print((char) c); } s.setTrafficClass(1); System.out.println(s.getTrafficClass()); s.close(); }