Closes the connection to the dbserver. This instance can no longer be used after this action.
175237
void close() {
        try {
            performTeardownExchange();
        } catch (IOException e) {
            logger.warn("Problem reporting our intention to close the dbserver connection", e);
        }
        try {
            channel.close();
        } catch (IOException e) {
            logger.warn("Problem closing dbserver client output channel", e);
        }
        try {
            os.close();
        } catch (IOException e) {
            logger.warn("Problem closing dbserver client output stream", e);
        }
        try {
            is.close();
        } catch (IOException e) {
            logger.warn("Problem closing dbserver client input stream", e);
        }
        try {
            socket.close();
        } catch (IOException e) {
            logger.warn("Problem closing dbserver client socket", e);
        }
    }
1370055
protected void close() {
        guard.close();

        if (fd != null) {
            datagramSocketClose();
            ResourceManager.afterUdpClose();
            fd = null;
        }
    }
148340
@Override
	public void close() {
		try {
			connection.close();
		} catch(IOException e) {
			log.log(Level.WARNING, "Could not close connection", e);
		}
	}
977303
def close(self):
        
        if self.connection is not None:
            self.connection.close()
        if self.connection_fd is not None:
            self.connection_fd.close()
357441
@PreDestroy
    public void close() {
        synchronized (operationOnConnectionMonitor) {
            if (state == State.CLOSED) {
                LOGGER.warn("Attempt to close connection factory which is already closed");
                return;
            }
            LOGGER.info("Closing connection factory");
            if (connection != null) {
                try {
                    connection.close();
                    connection = null;
                } catch (IOException e) {
                    if (! connection.isOpen()) {
                        LOGGER.warn("Attempt to close an already closed connection");
                    } else {
                        LOGGER.error("Unable to close current connection", e);
                    }
                }
            }
            changeState(State.CLOSED);
            LOGGER.info("Closed connection factory");
        }
    }
15950
protected void _disconnect() {
    IoSession currentSession = this.session;
    this.session = null;
    this.sentHandshake = null;
    this.receivedHandshake = null;
    this.attributeAliasValues.clear();
    this.originAliasValues.clear();

    if (currentSession != null && !currentSession.isClosing()) {

      log.info(
          "Closing connection to World Model (client) at {} (waiting {}ms).",
          currentSession.getRemoteAddress(),
          Long.valueOf(this.connectionTimeout));
      while (!currentSession.close(false).awaitUninterruptibly(
          this.connectionTimeout)) {
        log.error("Connection didn't close after {}ms.",
            Long.valueOf(this.connectionTimeout));
      }
    }

    if (currentSession != null) {
      for (ConnectionListener listener : this.connectionListeners) {
        listener.connectionInterrupted(this);
      }
    }
  }
99742
@Override
	public void close() {
		lockDb.lock();
		try {
			if (openCounter.decrementAndGet() <= 0) {

				if (!this.options.inMemory) {
					// Closing database
					if (database != null) {
						clearCompiledStatements();
						database.close();
					}
					database = null;
				}
				if (logEnabled)
					Logger.info("database CLOSED (%s) (connections: %s)", status.get(), openCounter.intValue());
			} else {
				if (logEnabled)
					Logger.info("database RELEASED (%s) (connections: %s)", status.get(), openCounter.intValue());
			}
		} finally {
			switch (status.get()) {
			case READ_AND_WRITE_OPENED:
				if (database == null)
					status.set(TypeStatus.CLOSED);
				lockReadWriteAccess.unlock();
				lockDb.unlock();
				break;
			case READ_ONLY_OPENED:
				if (database == null)
					status.set(TypeStatus.CLOSED);
				lockReadAccess.unlock();
				lockDb.unlock();
				break;
			case CLOSED:
				// do nothing
				lockDb.unlock();
				break;
			default:
				lockDb.unlock();
				throw (new KriptonRuntimeException("Inconsistent status"));
			}

		}

	}
929880
def close
      return if sessions.empty?
      sessions.each do |session|
        session.close
        session.delete_observer self
      end
      # TODO: should close database connection
    end
317289
def close(self):
        '''
        
        '''
        if self._wrapped_connection and self._pool:
            logger.debug("Returning connection %s to pool %s" % (self._wrapped_connection, self._pool))
            self._pool.putconn(self._wrapped_connection)
            self._wrapped_connection = None
818844
def close
      connection.protocol::DbClose.new(params).process(connection)
      @session = OrientdbBinary::OperationTypes::NEW_SESSION
      @clusters = nil
    end
962608
async def close(self):
        
        if self._server:
            self._server.close()
            self._server = None
            coro = self._close_connections()
            if coro:
                await coro
            self.logger.debug('%s closed', self)
            self.event('stop').fire()
827759
public void disconnect() {
        if (this.connection == null) {
            return;
        }

        try {
            if (this.rawInputStream == null) {
                this.rawInputStream = this.connection.getInputStream();
            }

            // We need to manually read from the raw input stream in case there are any remaining bytes. There's a bug
            // where a wrapping GZIPInputStream may not read to the end of a chunked response, causing Java to not
            // return the connection to the connection pool.
            byte[] buffer = new byte[BUFFER_SIZE];
            int n = this.rawInputStream.read(buffer);
            while (n != -1) {
                n = this.rawInputStream.read(buffer);
            }
            this.rawInputStream.close();

            if (this.inputStream != null) {
                this.inputStream.close();
            }
        } catch (IOException e) {
            throw new BoxAPIException("Couldn't finish closing the connection to the Box API due to a network error or "
                + "because the stream was already closed.", e);
        }
    }
38791
@Override
  public void close() throws SQLException
  {
    logger.debug(" public void close()");

    if (isClosed)
    {
      // No exception is raised even if the connection is closed.
      return;
    }

    isClosed = true;
    try
    {
      if (sfSession != null)
      {
        sfSession.close();
        sfSession = null;
      }

      // make sure to close all created statements
      synchronized (openStatements)
      {
        for (Statement stmt : openStatements)
        {
          if (stmt != null && !stmt.isClosed())
          {
            if (stmt.isWrapperFor(SnowflakeStatementV1.class))
            {
              stmt.unwrap(SnowflakeStatementV1.class).close(false);
            }
            else
            {
              stmt.close();
            }
          }
        }
        openStatements.clear();
      }
    }
    catch (SFException ex)
    {
      throw new SnowflakeSQLException(
          ex.getCause(), ex.getSqlState(), ex.getVendorCode(), ex.getParams());
    }
  }
831628
def close(self):
        
        logger.info("Closing connection to %s:%s", self._host, self._port)
        self._ioloop_future.cancel()
        try:
            yield from self._ioloop_future
        except asyncio.CancelledError:
            pass
672146
public void close() {
    if (zooKeeper != null) {
      try {
        zooKeeper.close();
      } catch (InterruptedException e) {
        LOG.error("Interrupt when closing zookeeper connection", e);
      }
    }
  }
562445
def close(self):
        
        with self.lock:
            if self.is_closed:
                return
            self.is_closed = True

        log.debug("Closing connection (%s) to %s", id(self), self.endpoint)
        reactor.callFromThread(self.connector.disconnect)
        log.debug("Closed socket to %s", self.endpoint)

        if not self.is_defunct:
            self.error_all_requests(
                ConnectionShutdown("Connection to %s was closed" % self.endpoint))
            # don't leave in-progress operations hanging
            self.connected_event.set()
718593
@Override
  public void close() throws SQLException {
    super.close();
    if (connection == null || connection.pooledConnection == null
        || connection.pooledConnection.noStmtEventListeners()) {
      return;
    }
    connection.pooledConnection.fireStatementClosed(this);
    connection = null;
  }