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) {
Stop searching for code, let great code find you!  Add Codota to your java IDE