예제 #1
0
  private void finish(boolean close) throws BadDescriptorException, IOException {
    try {
      flushWrite();

      if (DEBUG) LOG.info("Descriptor for fileno {} closed by stream", descriptor.getFileno());
    } finally {
      buffer = EMPTY_BUFFER;

      // clear runtime so it doesn't get stuck in memory (JRUBY-2933)
      runtime = null;

      // finish descriptor
      descriptor.finish(close);
    }
  }
예제 #2
0
 /**
  * Close this descriptor. If in closing the last ChannelDescriptor reference to the associate
  * channel is closed, the channel itself will be closed.
  *
  * @throws org.jruby.util.io.BadDescriptorException if the associated channel is already closed
  * @throws java.io.IOException if there is an exception during IO
  */
 public void close() throws BadDescriptorException, IOException {
   // tidy up
   finish(true);
 }