Code example for ProxySelector

Methods: select

0
        for (int i = 0; i < NUM_THREADS; i++) {
            threads[i] = new Thread(new Runnable() {
                @Override 
                public void run() { 
                    try { 
                        ps.select(uri);
                    } catch (Exception x) {
                        throw new RuntimeException(x);
                    } 
                } 
            }); 
        } 
        for (int i = 0; i < NUM_THREADS; i++) {
            threads[i].start();
        } 
        for (int i = 0; i < NUM_THREADS; i++) {
            threads[i].join();
        } 
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE