// Close closesthe connection
189865
func (c *StandardXMLSearchResult) Close() error {
	if c == nil || c.body == nil {
		return nil
	}
	return c.body.Close()
}
261620
func (c *Connection) Close() error {
	if !c.returnOnClose {
		if c.Conn != nil {
			return c.Conn.Close()
		}
		return nil
	}
	c.owner.Release(c, nil)
	return nil
}
175162
func (p *conn) Close() error {
	p.Lock()
	defer p.Unlock()
	if p.IsOpen() {
		p.open = false
		return p.c.Close()
	}
	return nil
}
678709
func (cli *Client) Close() error {
	if t, ok := cli.client.Transport.(*http.Transport); ok {
		t.CloseIdleConnections()
	}
	return nil
}
17982
func (client *Client) closeConnection(connectionID int) error {
	request := newOpClientRequest(opClientCloseConnection, connectionID)
	client.opRequests <- request
	response := <-request.response
	if val, ok := response.(error); ok {
		return val
	}
	return nil
}
1018392
func (c *StreamConnection) Close() {
	c.lock.Lock()
	defer c.lock.Unlock()

	if c.Closed() {
		return
	}

	logger.Debug("Closing stream....")
	if err := c.stream.CloseSend(); err != nil {
		logger.Warnf("error closing GRPC stream: %s", err)
	}

	c.GRPCConnection.Close()
}
897122
func (c *Client) Close() error {
	if err := c.LeaveRealm(); err != nil {
		return err
	}
	if err := c.Peer.Close(); err != nil {
		return fmt.Errorf("error closing client connection: %v", err)
	}
	return nil
}
1265020
func (c *connectionTracker) Close() {
	c.lock.Lock()
	defer c.lock.Unlock()
	for conn := range c.conns {
		if err := conn.Close(); err != nil {
			log.WithoutContext().Errorf("Error while closing connection: %v", err)
		}
		delete(c.conns, conn)
	}
}
1283702
func (c *Connect) Close() (int, error) {
	var err C.virError
	result := int(C.virConnectCloseWrapper(c.ptr, &err))
	if result == -1 {
		return result, makeError(&err)
	}
	if result == 0 {
		// No more reference to this connection, release data.
		releaseConnectionData(c)
		c.ptr = nil
	}
	return result, nil
}
1240535
func (c *NamenodeConnection) Close() error {
	if c.conn != nil {
		return c.conn.Close()
	}
	return nil
}
686495
func (c *proxyConnection) Close() {
	scopedLog := log.WithField(fieldConn, c)

	c.closeLocker.Lock()
	select {
	case <-c.close:
		// Already closed. Nothing to do.
		c.closeLocker.Unlock()
		return
	default:
	}
	// Cause writeQueuedMessages to terminate.
	close(c.close)
	c.closeLocker.Unlock()

	// Actually close the TCP connection. This will unblock any eventually
	// blocking c.conn.Write call in writeQueuedMessages.
	if !c.Closed() {
		scopedLog.Debug("Closing socket")
		c.conn.Close()
	}

	// Call connectionPair.close() concurrently so that this call doesn't block
	// while waiting for the other connection in the pair to close.
	go c.afterClose()
}
421909
func (conn *Conn) Close() error {
	conn.outLck.Lock()
	close(conn.out)
	conn.closed = true
	conn.outLck.Unlock()
	conn.signalsLck.Lock()
	for _, ch := range conn.signals {
		close(ch)
	}
	conn.signalsLck.Unlock()
	conn.eavesdroppedLck.Lock()
	if conn.eavesdropped != nil {
		close(conn.eavesdropped)
	}
	conn.eavesdroppedLck.Unlock()
	return conn.transport.Close()
}
1268285
func (c *Conn) Close() error {
	return c.opError(opClose, c.fd.Close())
}
584291
func (c *Conn) Close() {
	if c.closed.CompareAndSwap(false, true) {
		c.conn.Close()
	}
}
953111
func (cp *ConnectionPool) Close() {
	p := cp.pool()
	if p == nil {
		return
	}
	// We should not hold the lock while calling Close
	// because it waits for connections to be returned.
	p.Close()
	cp.mu.Lock()
	cp.connections = nil
	cp.addresses = nil
	cp.hostIsNotIP = false
	if cp.ticker != nil {
		cp.ticker.Stop()
		close(cp.stop)
	}
	cp.mu.Unlock()
	cp.wg.Wait()
}
619198
func (p *Pool) Close() {
	p.mu.Lock()
	defer p.mu.Unlock()

	for _, c := range p.connections {
		p.errorChannel <- c.removeFromPool()
	}
	close(p.errorChannel)
}
1365459
func (p *ConnPool) Close() {
	p.cond.L.Lock()
	defer p.cond.L.Unlock()

	p.closed = true

	for _, c := range p.availableConnections {
		_ = c.Close()
	}

	// This will cause any checked out connections to be closed on release
	p.resetCount++
}