Code example for SocketException

0
    @Override 
    synchronized protected void implCloseSelectableChannel() throws IOException { 
        if (SOCKET_STATUS_CLOSED != status) {
            status = SOCKET_STATUS_CLOSED;
            if (null != socket && !socket.isClosed()) {
                socket.close();
            } else { 
                networkSystem.socketClose(fd);
            } 
        } 
    } 
 
    /** 
     * @see java.nio.channels.spi.AbstractSelectableChannel#implConfigureBlocking(boolean) 
     */ 
    @Override 
    protected void implConfigureBlocking(boolean blockMode) throws IOException {
        synchronized (blockingLock()) {
            networkSystem.setNonBlocking(fd, !blockMode);
        } 
    }