Examples of ClosedChannelException


Examples of java.nio.channels.ClosedChannelException

      private boolean open = true;

      public int write(ByteBuffer src) throws IOException {
        if (open == false) {
          throw new ClosedChannelException();
        }

        final int p = buffer.position();
        final int l = buffer.limit();
        final int r = src.remaining();
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

      private boolean open = true;

      public int read(ByteBuffer dst) throws IOException {
        if (open == false) {
          throw new ClosedChannelException();
        }

        final int p = buffer.position();
        final int l = buffer.limit();
        final int r = dst.remaining();
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

         
        // if underlying connection is closed throwing a ClosedChannelException, because
        // the body is not complete
        } else {
          isOpen.set(false);
          throw new ClosedChannelException();
        }
      }
     
    } else {
      return available;
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

 
  private void preAppend() throws IOException {
    lastTimeDataReceivedMillis = System.currentTimeMillis();
   
    if (!isOpen.get() || isDestroyed.get()) {
      throw new ClosedChannelException();
    }
  }
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

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

Examples of java.nio.channels.ClosedChannelException

                       
                        if (isPrimarySinkClosed.get()) {
                            if (!isSecondarySinkClosed.get()) {
                                write(secondarySink, isSecondarySinkClosed, buffer);
                            } else {
                                throw new ClosedChannelException();
                            }
                        } else {
                            if (!isSecondarySinkClosed.get()) {
                                write(secondarySink, isSecondarySinkClosed, buffer.duplicate());
                            }
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

   
    if (!isDisconnected.getAndSet(true)) {
     
      // notify pending handlers
      while (!bodyReceivingResponseHandlers.isEmpty()) {
        bodyReceivingResponseHandlers.remove(0).onException(new ClosedChannelException());
      }
     
     
      // notify waiting handler
      for (MessageHandler messageHandler : getHandlersWaitingForResponseCopy()) {
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

        destroy();
        throw new IOException(msg);
      }
     
    } else {
      throw new ClosedChannelException();
    }   
  }
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

        destroy();
        throw new IOException(msg);
      }
     
    } else {
      throw new ClosedChannelException();
    }   

  }
View Full Code Here

Examples of java.nio.channels.ClosedChannelException

        destroy();
        throw new IOException(msg);
      }
       
    } else {
      throw new ClosedChannelException();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.