Code example for DatagramSocket

Methods: closegetTrafficClass

        int IPTOS_LOWDELAY = 0x10;
        int[] ports = Support_PortManager.getNextPortsForUDP(2);
        new InetSocketAddress(InetAddress.getLocalHost(),
        DatagramSocket theSocket = new DatagramSocket(ports[1]);
         * we cannot actually check that the values are set as if a platform 
         * does not support the option then it may come back unset even 
         * though we set it so just get the value to make sure we can get it 
        int trafficClass = theSocket.getTrafficClass();
        try { 
            fail("SocketException was not thrown.");
        } catch(SocketException se) {
Contextual code suggestions in your IDE  Get Codota for Java