Code example for ServerSocketChannel

Methods: acceptisOpenconfigureBlocking

0
            // correct 
        } 
    } 
 
    public void testAccept_NonBlock_NotYetBound() throws IOException { 
        assertTrue(this.serverChannel.isOpen());
        this.serverChannel.configureBlocking(false);
        try { 
            this.serverChannel.accept();
            fail("Should throw NotYetBoundException");
        } catch (NotYetBoundException e) {
            // correct 
        } 
    } 
 
    public void testAccept_ClosedChannel() throws Exception { 
        this.serverChannel.close();
        assertFalse(this.serverChannel.isOpen());
        try { 
            this.serverChannel.accept();
            fail("Should throw ClosedChannelException");