Return a fresh :class:`httplib.HTTPSConnection`.
189959
def _new_conn(self):
        
        self.num_connections += 1
        log.info("Starting new HTTPS connection (%d): %s"
                 % (self.num_connections, self.host))

        if not ssl:
            return HTTPSConnection(host=self.host, port=self.port)

        connection = VerifiedHTTPSConnection(host=self.host, port=self.port)
        connection.set_cert(key_file=self.key_file, cert_file=self.cert_file,
                            cert_reqs=self.cert_reqs, ca_certs=self.ca_certs)
        return connection
1199050
def connect(url, prefix=None, **kwargs):
    
    return connection(url, prefix=get_prefix(prefix), **kwargs)
942690
def _threadsafe_get_connection(self):
        """"""
        self._lock.acquire()
        try:
            next = self._nextConnection
            con = PooledDBConnection(self, self._connections[next])
            next += 1
            if next >= len(self._connections):
                next = 0
            self._nextConnection = next
            return con
        finally:
            self._lock.release()
802770
def lazy_connect(cls, pk):
        
        instance = cls()
        instance._pk = instance.pk.normalize(pk)
        instance._connected = False
        return instance
828368
def steady_connection(self):
        """"""
        return SteadyPgConnection(self._maxusage, self._setsession, True,
                                  *self._args, **self._kwargs)
200506
def _get_new_connection(self, conn_params):
    """"""
    self.__connection_string = conn_params.get('connection_string', '')
    conn = self.Database.connect(**conn_params)
    return conn
98558
def createConnection(self):
        """"""
        uri = self.reader.createConnection()
        return Pyro.core.getAttrProxyForURI(uri)
1355820
def get_connection(self, *args, **kwargs):
        
        conn = super(SSLAdapter, self).get_connection(*args, **kwargs)
        if conn.assert_hostname != self.assert_hostname:
            conn.assert_hostname = self.assert_hostname
        return conn
1175162
def connect(self):
        """"""
        logger.debug("Opening connection to %s:%s", self.url.hostname, self.url.port)
        try:
            self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port)
            self.connection.connect()
        except (httplib.HTTPException, socket.error) as e:
            raise errors.InterfaceError('Unable to connect to the specified service', e)
302089
def _acquire_request_connection(self, request):
        ''''''
        host = request.url_info.hostname
        port = request.url_info.port
        use_ssl = request.url_info.scheme == 'https'
        tunnel = request.url_info.scheme != 'http'

        connection = yield from self._acquire_connection(host, port, use_ssl, tunnel)

        return connection
947226
def get_connection(self):
        """"""
        if self.host is None:
            connector = SpamCUnixConnector
            conn = connector(self.socket_file, self.backend_mod)
        else:
            connector = SpamCTcpConnector
            conn = connector(
                self.host,
                self.port,
                self.backend_mod,
                is_ssl=self.is_ssl,
                **self.ssl_args)
        return conn
988446
def get_http_connection(self, host, is_secure):
        
        if is_secure:
            return AsyncHTTPSConnection(host, http_client=self._httpclient)
        else:
            return AsyncHTTPConnection(host, http_client=self._httpclient)
333647
def get(self):
        
        # Discard ready connections that are too old.
        self.clean()

        # Return the first connection that is ready, and remove it
        # from the queue.  Connections that aren't ready are returned
        # to the end of the queue with an updated time, on the
        # assumption that somebody is actively reading the response.
        for _ in range(len(self.queue)):
            (conn, _) = self.queue.pop(0)
            if self._conn_ready(conn):
                return conn
            else:
                self.put(conn)
        return None
375232
def connection(self):
        
        connection = getattr(self.state, "connection", None)
        if connection is None:
            connection = self.state.connection = pika.BlockingConnection(
                parameters=self.parameters)
            self.connections.add(connection)
        return connection
689014
def _ensure_connection(self):
        """"""
        conn = self.connect()
        if conn.recycle and conn.recycle < time.time():
            logger.debug('Client session expired after %is. Recycling.', self._recycle)
            self.close()
            conn = self.connect()
        return conn
1338598
def steady_connection(self):
        """"""
        return connect(
            self._creator, self._maxusage, self._setsession,
            self._failures, self._ping, self._closeable,
            *self._args, **self._kwargs)
461720
def getReqId(self) -> int:
        
        if not self.isReady():
            raise ConnectionError('Not connected')
        newId = self._reqIdSeq
        self._reqIdSeq += 1
        return newId