Code example for InetSocketAddress

Methods: getPort

0
    } 
    /** 
     * Regression test for HARMONY-4961 
     */ 
    public void test_socket_getLocalPort() throws IOException { 
        serverChannel.socket().bind(localAddr1);
        clientChannel.connect(localAddr1);
        SocketChannel myChannel = serverChannel.accept();
        int port = myChannel.socket().getLocalPort();
        assertEquals(localAddr1.getPort(), port);
        myChannel.close();
        clientChannel.close();
        serverChannel.close();
    } 
 
    /** 
     * Regression test for HARMONY-6375 
     */ 
    public void test_accept_configureBlocking() throws Exception { 
        InetSocketAddress localAddr = new InetSocketAddress("localhost", 0);
Stop searching for code, let great code find you!  Add Codota to your java IDE