Code example for ServerSocketChannel

Methods: socketconfigureBlocking

0
    /** 
     * @tests ServerSocket#socket().accept() 
     */ 
    public void test_socket_accept_Blocking_NotBound() throws IOException { 
        // regression test for Harmony-748 
        ServerSocket gotSocket = serverChannel.socket();
        serverChannel.configureBlocking(true);
        try { 
            gotSocket.accept();
            fail("Should throw an IllegalBlockingModeException");
        } catch (IllegalBlockingModeException e) {
            // expected 
        } 
        serverChannel.close();
        try { 
            gotSocket.accept();
            fail("Should throw an IllegalBlockingModeException");
        } catch (IllegalBlockingModeException e) {
            // expected 
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE