Package java.nio.channels

Examples of java.nio.channels.ClosedChannelException


                  LOG.fine("waiting for " + (length - delegate.size()) + "bytes (guard: " + readGuard + ")");
              }

            waitingForData(readGuard, remainingTime);
          } else {
            throw new ClosedChannelException();
          }
        }
      }

      remainingTime = computeRemainingTime(start, receiveTimeoutSec);
View Full Code Here


     * {@inheritDoc}
     */
    public final void flush() throws IOException {
      isFlushed = true;
        if (!isOpen.get() && !isIgnoreWriteError.get() && !writeQueue.isEmpty()) {
            throw new ClosedChannelException();
        }

        internalFlush();
    }
View Full Code Here

 
  IPart readPart() throws ClosedChannelException {
    synchronized (parts) {
      if (parts.isEmpty()) {
        if (isTotalComplete.get()) {
          throw new ClosedChannelException();
        } else {
          throw new BufferUnderflowException();
        }
      } else {
        return parts.remove(0);
View Full Code Here

     * {@inheritDoc}
     */
    public final void flush() throws IOException {
      isFlushed = true;
        if (!isOpen.get() && !isIgnoreWriteError.get() && !writeQueue.isEmpty()) {
            throw new ClosedChannelException();
        }

        internalFlush();
    }
View Full Code Here

            } else {
               
                // is destroyed?
                if (isDestroyed.get()) {
                    close();
                    throw new ClosedChannelException();
                } else {
                    return 0;
                }
            }
           
View Full Code Here

            } else {
               
                // is destroyed?
                if (isDestroyed.get()) {
                    close();
                    throw new ClosedChannelException();
                } else {
                    return 0;
                }
            }
           
View Full Code Here

     * {@inheritDoc}
     */
    public final void flush() throws IOException {
      isFlushed = true;
        if (!isOpen.get() && !isIgnoreWriteError.get() && !writeQueue.isEmpty()) {
            throw new ClosedChannelException();
        }

        internalFlush();
    }
View Full Code Here

                if (ioe != null) {
                    throw ioe;
                }
               
                if (isDisconnected.get()) {
                    throw new ClosedChannelException();
                }
               
                if (inQueue.isEmpty()) {
                    try {
                        inQueue.wait(remainingTime);
View Full Code Here

    }
   
   
    public int writeMessage(WebSocketMessage msg) throws IOException {
        if (isCloseMsgSent.get()) {
            throw new ClosedChannelException();
        }
       
        return writeMessageIgnoreClose(msg);
    }
View Full Code Here

        return msg.writeTo(this, null);
    }
   
    public void writeMessage(WebSocketMessage msg, IWriteCompleteHandler writtenHandler) throws IOException {
        if (isCloseMsgSent.get()) {
            throw new ClosedChannelException();
        }

        if (interceptor != null) {
            interceptor.onPreWrite();
        }
View Full Code Here

TOP

Related Classes of java.nio.channels.ClosedChannelException

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.