Close the connection.
774066
public void close() throws IOException
  {
    if (_isKeepalive) {
      // If recycling, read any unread data
      if (! _didGet)
        getConnInput();

      if (! _isRequestDone) {
        if (_tempBuffer == null)
          _tempBuffer = new byte[256];

        try {
          while (read(_tempBuffer, 0, _tempBuffer.length) > 0) {
          }
        } catch (IOException e) {
          _isKeepalive = false;
        }
      }
    }

    if (_isKeepalive) {
      HttpStream oldSaved;
      
      long now;
      
      now = CurrentTime.currentTime();
      
      synchronized (LOCK) {
        oldSaved = _savedStream;
        _savedStream = this;
        _saveTime = now;
      }

      if (oldSaved != null && oldSaved != this) {
        oldSaved._isKeepalive = false;
        oldSaved.close();
      }

      return;
    }

    try {
      try {
        if (_ws != null)
          _ws.close();
      } catch (Throwable e) {
      }
      _ws = null;

      try {
        if (_rs != null)
          _rs.close();
      } catch (Throwable e) {
      }
      _rs = null;

      try {
        if (_os != null)
          _os.close();
      } catch (Throwable e) {
      }
      _os = null;

      try {
        if (_is != null)
          _is.close();
      } catch (Throwable e) {
      }
      _is = null;
    } finally {
      if (_s != null)
        _s.close();
      _s = null;
    }
  }
354318
def close(self):
        """"""
        if self._local.conn:
            self._local.conn.transport.close()
        self._local.conn = None
1357279
def close(self):
        
        LOGGER.debug('Connection Closing')
        if not self.is_closed:
            self.set_state(self.CLOSING)
        self.heartbeat.stop()
        try:
            if not self.is_closed and self.socket:
                self._channel0.send_close_connection()
                self._wait_for_connection_state(state=Stateful.CLOSED)
        except AMQPConnectionError:
            pass
        finally:
            self._close_remaining_channels()
            self._io.close()
            self.set_state(self.CLOSED)
        LOGGER.debug('Connection Closed')
136742
protected void close() {
        _state = State.DISCONNECTED;

        shutdown();

        // remove the connection from map
        NetMgr.getInstance().dropConnection(InetSocketAddress.createUnresolved(_remoteHost, _port));

        // notify all the pending requests in the timeout map
        notifyAllPendingSenders("Channel closed, connection closing.");
    }
831135
def close(self):
        """"""
        for handle in self._handles:
            if not handle.closed:
                handle.close()
        del self._handles[:]
        for transport, _ in self.connections:
            transport.close()
        self._all_closed.wait()
1370167
def close_connection(self, host):
        """"""
        for h in self._cm.get_all(host):
            self._cm.remove(h)
            h.close()
1035064
def close(self):
        """"""
        # Instead of actually closing the connection,
        # return it to the pool so it can be reused.
        if self._con is not None:
            self._pool.cache(self._con)
            self._con = None
1170264
def close(self):
        """"""

        if self.closed or self.connection.closed:
            return

        self._cursor.close()
        self.closed = True
220813
def close(self):
        """"""
        if self.sock:
            self.sock.close()   # close it manually... there may be other refs
            self.sock = None
        if self.__response:
            self.__response.close()
            self.__response = None
        self.__state = _CS_IDLE
715423
def close(self):
        """"""

        if hasattr(self, "conn"):
            self.conn.close()
            del self.conn
        if hasattr(self, "user"):
            del self.user
347878
def close(self):
        """"""
        if self.sock:
            self.sock.close()
        self.sock = 0
        self.eof = 1
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
936230
def close(self):
        ''''''
        if self._connection:
            self._connection_file.close()
            self._connection_file = None
            self._connection.close()
            self._connection = None
1134877
public function close(): void
    {
        if ($this->isClosed) {
            return;
        }

        $this->isEnding = true;
        $this->isClosed = true;

        $this->connection->close();
        $this->emit('close');

        $this->pool->rejectAll(new ConnectionClosedException());
    }
606650
def close(self):
        
        if (self.__ser is not None):
            self.__ser.close()
        if (self.__tcpClientSocket is not None):
            self.__stoplistening = True
            self.__tcpClientSocket.shutdown(socket.SHUT_RDWR)
            self.__tcpClientSocket.close()
        self.__connected = False
65891
public function close(): void
  {
    foreach($this->channels as $channel)
    {
      $channel->close();
    }
    $this->connection->close();
  }
1185592
def close(self):
        
        # Disconnect with a fancy message, then close connection
        if self._connection is not None:
            self._connection.disconnect("Bot is quitting")
            self._connection.close()
            self._connection = None

        # Stop the client loop
        self.__stopped.set()

        if self.__thread is not None:
            try:
                self.__thread.join(5)
            except RuntimeError:
                pass
            self.__thread = None