Ends the stream and closes the connection
977496
final public function close()
    {

        $this->onCloseConnection();

        if($this->socket){
            $this->write("</stream:stream>");
            parent::close();
            $this->connected = false;
        }

    }
152195
@Override
    public void close() throws IOException {
    	if (readAllBytesInternal() || isAborted()) {
            super.close();
        } else {
            LOG.warn(
                    "Not all bytes were read from the S3ObjectInputStream, aborting HTTP connection. This is likely an error and " +
                    "may result in sub-optimal behavior. Request only the bytes you need via a ranged GET or drain the input " +
                    "stream after use.");
            if (httpRequest != null) {
                httpRequest.abort();
            }
            IOUtils.closeQuietly(in, null);
        }
    }
557012
private void close(T stream) {

        // Attempt to close stream
        try {
            stream.close();
        }
        catch (IOException e) {
            logger.warn("Unable to close intercepted stream: {}", e.getMessage());
            logger.debug("I/O error prevented closure of intercepted stream.", e);
        }

        // Notify waiting threads that the stream has ended
        synchronized (stream) {
            stream.notify();
        }

    }
1310393
def close(self):
        """"""
        stream = self._stream
        if stream is None:
            return
        self._stream = None
        stream.close()
1321070
@Override
	public void close() throws Exception {
		// flag this as not running any more
		isRunning = false;

		// clean up in locked scope, so there is no concurrent change to the stream and client
		synchronized (lock) {
			// we notify first (this statement cannot fail). The notified thread will not continue
			// anyways before it can re-acquire the lock
			lock.notifyAll();

			try {
				if (outputStream != null) {
					outputStream.close();
				}
			}
			finally {
				if (client != null) {
					client.close();
				}
			}
		}
	}
412976
public void close() throws java.io.IOException{
        synchronized(this){
            if(_outHelper.isOutputStream_closed()){
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "output stream close previously completed ...return ");
                }
                return;
            }
            else{
                _outHelper.closeWork();
            }
        }
    }
1304627
public function closeInputStream()
    {
        if (!is_null($this->_inputStream)) {
            fclose($this->_inputStream);
            $this->_inputStream = null;
        }
    }
289373
public function stream_close()
    {
        if ($this->_upload !== null) {
            $this->_upload->complete();
            $this->_upload = null;
        }
        if ($this->_download !== null) {
            $this->_download = null;
        }
    }
793322
public void close() {
    if (this.isDisabled || this.closed) {
      // parent stream needs to check for success explicitly
      return;
    }
    closed = true;
    try {
      // send close request
      tasks.add(sendExecutor.submit(new SendWorker(
          new ByteArrayOutputStream(0), segmentId++, true)));

      // wait for all tasks to complete
      for (Future<Void> task : tasks) {
        task.get();
      }
    } catch (InterruptedException e) {
      setErrorStatus("Interrupted exception", e);
    } catch (ExecutionException e) {
      setErrorStatus("Execution exception", e);
    } finally {
      // close the executor
      sendExecutor.shutdownNow();
    }
  }
1097867
@Override
  public void close() throws IOException {
    if (inputStream != null) {
      inputStream.close();
      inputStream = null;
    }

    if (buffer != null) {
      buffer = null;
    }
  }
1208461
def _close(self):
        

        if self.stream:
            try:
                if not self.stream.closed:
                    # Flushing probably isn't technically necessary, but it feels right
                    self.stream.flush()
                    self.stream.close()
            finally:
                self.stream = None
148340
@Override
	public void close() {
		try {
			connection.close();
		} catch(IOException e) {
			log.log(Level.WARNING, "Could not close connection", e);
		}
	}
989626
public function close()
    {
        if (is_resource($this->stream) === true) {
            fclose($this->stream);
        }

        $this->detach();
    }
133929
protected function close()
    {
        if (is_resource($this->stream)) {
            $this->flush();
            fclose($this->stream);
        }
        $this->stream = false;
    }
1093703
def close(self):
        """"""
        # Instead of actually closing the connection,
        # unshare it and/or return it to the pool.
        if self._con:
            self._pool.unshare(self._shared_con)
            self._shared_con = self._con = None
689412
public void close() throws IOException
  {
    unlock();

    _fileChannel = null;

    InputStream is = _is;
    _is = null;
    
    if (is != null)
      is.close();
  }
1283786
def close_client_stream(client_stream, unix_path):
    
    try:
        client_stream.shutdown(socket.SHUT_RDWR)
        if unix_path:
            logger.debug('%s: Connection closed', unix_path)
        else:
            peer = client_stream.getpeername()
            logger.debug('%s:%s: Connection closed', peer[0], peer[1])
    except (socket.error, OSError) as exception:
        logger.debug('Connection closing error: %s', exception)
    client_stream.close()