Package java.nio.channels

Examples of java.nio.channels.WritePendingException


     * @return The number of bytes written, possibly zero
     */
    @Override
    public Future<Integer> write(ByteBuffer src) {
        if (writePending) {
            throw new WritePendingException();
        } else {
            writePending = true;
        }
        return new FutureWrite(src);
    }
View Full Code Here


        if (closing || closed) {
            handler.failed(new IOException("Channel is in closing state."), attachment);
            return;
        }
        if (writePending) {
            throw new WritePendingException();
        } else {
            writePending = true;
        }

        try {
View Full Code Here

        if (closing || closed) {
            handler.failed(new IOException("Channel is in closing state."), attachment);
            return;
        }
        if (writePending) {
            throw new WritePendingException();
        } else {
            writePending = true;
        }
        try {
            GatherState<A> state = new GatherState<>(srcs, offset, length,
View Full Code Here

            {
                case CLOSED:
                    break loop;
                   
                case UNREADY:
                    throw new WritePendingException(); // TODO ?
                   
                default:
                    if (_state.compareAndSet(state,OutputState.CLOSED))
                    {
                        try
View Full Code Here

            {
                case CLOSED:
                    break loop;
                   
                case UNREADY:
                    throw new WritePendingException(); // TODO ?
                   
                default:
                    if (_state.compareAndSet(state,OutputState.CLOSED))
                    {
                        try
View Full Code Here

                    new AsyncFlush().iterate();
                    return;

                case PENDING:
                case UNREADY:
                    throw new WritePendingException();

                case CLOSED:
                    return;
            }
            break;
View Full Code Here

                    new AsyncWrite(b,off,len,complete).iterate();
                    return;

                case PENDING:
                case UNREADY:
                    throw new WritePendingException();

                case CLOSED:
                    throw new EofException("Closed");
            }
            break;
View Full Code Here

                    new AsyncWrite(buffer,complete).iterate();
                    return;

                case PENDING:
                case UNREADY:
                    throw new WritePendingException();

                case CLOSED:
                    throw new EofException("Closed");
            }
            break;
View Full Code Here

                    new AsyncFlush().iterate();
                    return;

                case PENDING:
                case UNREADY:
                    throw new WritePendingException();

                case CLOSED:
                    throw new EofException("Closed");
            }
            break;
View Full Code Here

    {
        if (DEBUG)
            LOG.debug("write: {} {}", this, BufferUtil.toDetailString(buffers));

        if (!updateState(__IDLE,__WRITING))
            throw new WritePendingException();

        try
        {
            boolean flushed=_endPoint.flush(buffers);
            if (DEBUG)
View Full Code Here

TOP

Related Classes of java.nio.channels.WritePendingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.