Code example for IllegalBlockingModeException

0
    synchronized private void checkUnconnected() throws IOException { 
        if (!isOpen()) {
            throw new ClosedChannelException();
        } 
        if (status == SOCKET_STATUS_CONNECTED) {
            throw new AlreadyConnectedException();
        } 
        if (status == SOCKET_STATUS_PENDING) {
            throw new ConnectionPendingException();
        } 
    } 
 
    /* 
     * Shared by this class and DatagramChannelImpl, to do the address transfer 
     * and check. 
     */ 
    static InetSocketAddress validateAddress(SocketAddress socketAddress) {
        if (null == socketAddress) {
            throw new IllegalArgumentException();
        } 
        if (!(socketAddress instanceof InetSocketAddress)) {