Connect to bitcoind
494030
def get_bitcoind_client(config_path=None, bitcoind_opts=None):
    
    if bitcoind_opts is None and config_path is None:
        raise ValueError("Need bitcoind opts or config path")

    bitcoind_opts = get_bitcoind_config(config_file=config_path)
    log.debug(" at %s:%s (%s)" % (bitcoind_opts['bitcoind_server'], bitcoind_opts['bitcoind_port'], config_path))
    client = connect_bitcoind_impl( bitcoind_opts )

    return client
1096300
def connect(*args, **kwargs):
    """"""
    kwargs['cursor_factory'] = TraceCursor
    conn = pg_connect(*args, **kwargs)
    return conn
1013418
def _Connect(self):
    """"""
    elastic_host = {'host': self._host, 'port': self._port}

    if self._url_prefix:
      elastic_host['url_prefix'] = self._url_prefix

    elastic_http_auth = None
    if self._username is not None:
      elastic_http_auth = (self._username, self._password)

    self._client = elasticsearch.Elasticsearch(
        [elastic_host],
        http_auth=elastic_http_auth,
        use_ssl=self._use_ssl,
        ca_certs=self._ca_certs
    )

    logger.debug(
        ('Connected to Elasticsearch server: {0:s} port: {1:d}'
         'URL prefix {2!s}.').format(self._host, self._port, self._url_prefix))
875594
def connect(self):
        
        logger.info("Connecting to Redis on {host}:{port}...".format(
            host=self.host, port=self.port))

        super(RedisSubscriber, self).connect()
        logger.info("Successfully connected to Redis")

        # Subscribe to channel
        self.pubsub = self.client.pubsub()
        self.pubsub.subscribe(self.channel)

        logger.info("Subscribed to [{channel}] Redis channel".format(
            channel=self.channel))

        # Start listening
        t = Thread(target=self.listen)
        t.setDaemon(True)
        t.start()
1151151
function connect() {
    if (!redis) {
      debug('createClient ' + key + ' at ' + host + ':' + port);
      redis = redisLib.createClient(port, host, redisOpts); }
  }
1162626
def get_bitcoind_client():
    
    bitcoind_opts = get_bitcoin_opts()
    bitcoind_host = bitcoind_opts['bitcoind_server']
    bitcoind_port = bitcoind_opts['bitcoind_port']
    bitcoind_user = bitcoind_opts['bitcoind_user']
    bitcoind_passwd = bitcoind_opts['bitcoind_passwd']
    
    return create_bitcoind_service_proxy(bitcoind_user, bitcoind_passwd, server=bitcoind_host, port=bitcoind_port)
1306846
def connect(self):
        
        self._connect()
        logger.debug('Connected to Deluge, detecting daemon version')
        self._detect_deluge_version()
        logger.debug('Daemon version {} detected, logging in'.format(self.deluge_version))
        if self.deluge_version == 2:
            result = self.call('daemon.login', self.username, self.password, client_version='deluge-client')
        else:
            result = self.call('daemon.login', self.username, self.password)
        logger.debug('Logged in with value %r' % result)
        self.connected = True
423464
def connect(self, username, checksum, password=None, key=None):
        """"""

        ws_url = (
            f"{BASE_WS_URL}?room={self.room.room_id}&cs={checksum}&nick={username}"
            f"&rn={random_id(6)}&t={int(time.time() * 1000)}&transport=websocket&EIO=3"
        )
        if password:
            ws_url += f"&password={password}"
        elif key:
            ws_url += f"&key={key}"

        ARBITRATOR.create_connection(
            self.proto, ws_url, self.headers["User-Agent"], self.cookies
        )
        self.__conn_barrier.wait()
1254485
def _connect(self):
        ""
        self.socket = socket.socket()
        self.socket.connect((self.config['host'], self.config['port']))
        self.cmd("NICK %s" % self.config['nick'])
        self.cmd("USER %s %s bla :%s" %
                (self.config['ident'], self.config['host'], self.config['realname']))
950528
def get_bitcoind_info(self):
        
        cached_bitcoind_info = self.get_cached_bitcoind_info()
        if cached_bitcoind_info:
            return cached_bitcoind_info

        bitcoind_opts = default_bitcoind_opts( virtualchain.get_config_filename(virtualchain_hooks, self.working_dir), prefix=True )
        bitcoind = get_bitcoind( new_bitcoind_opts=bitcoind_opts, new=True )

        if bitcoind is None:
            return {'error': 'Internal server error: failed to connect to bitcoind'}
        
        try:
            info = bitcoind.getinfo()
            assert 'error' not in info
            assert 'blocks' in info

            self.set_cached_bitcoind_info(info)
            return info

        except Exception as e:
            raise
401572
def _connect(self):
        """"""
        self._soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self._soc.connect((self._ipaddr, self._port))
        self._soc.send(_build_request({'cmd': cmd.CMD_MESSAGE_PASSWORD,
                                       'sha': self._password}))
734202
def connect(self, cback, subscribers=None, instance=None):
        
        if subscribers is None:
            subscribers = self.subscribers
        # wrapper
        if self._fconnect is not None:
            def _connect(cback):
                self._connect(subscribers, cback)

            notify = partial(self._notify_one, instance)
            if instance is not None:
                result = self._fconnect(instance, cback, subscribers,
                                        _connect, notify)
            else:
                result = self._fconnect(cback, subscribers, _connect, notify)
            if inspect.isawaitable(result):
                result = pull_result(result)
        else:
            self._connect(subscribers, cback)
            result = None
        return result
1107199
public void connect() throws IOException {
        SmbTransport trans;
        SmbSession ssn;
        UniAddress addr;

        if( isConnected() ) {
            return;
        }

        getUncPath0();
        getFirstAddress();
        for ( ;; ) {
            try {
                doConnect();
                return;
            } catch(SmbAuthException sae) {
                throw sae; // Prevents account lockout on servers with multiple IPs
            } catch(SmbException se) {
                if (getNextAddress() == null) 
                    throw se;
                if (log.level >= 3)
                    se.printStackTrace(log);
            }
        }
    }
823383
def connect(self):
        
        logger.info("Connecting to RabbitMQ on {broker_url}...".format(
            broker_url=self.broker_url))

        super(RabbitMQSubscriber, self).connect()

        q = Queue(exchange=self.exchange, exclusive=True, durable=False)

        self.queue = q(self.connection.default_channel)
        self.queue.declare()

        self.thread = Thread(target=self.listen)
        self.thread.setDaemon(True)
        self.thread.start()
106726
function connect() {
    // clear pending timeouts
    clearTimeout(timeoutConnectRef);

    // if client already open, just run
    if (client.isOpen) {
        run();
    }

    // if client closed, open a new connection
    client.connectTCP("127.0.0.1", { port: 8502 })
        .then(setClient)
        .then(function() {
            console.log("Connected"); })
        .catch(function(e) {
            checkError(e);
            console.log(e.message); });
}
1123492
def connect(self, *args):
        """"""

        self.log("Connect ", args, lvl=verbose)

        try:
            sock = args[0]
            ip = args[1]

            if sock not in self._sockets:
                self.log("New client connected:", ip, lvl=debug)
                clientuuid = str(uuid4())
                self._sockets[sock] = Socket(ip, clientuuid)
                # Key uuid is temporary, until signin, will then be replaced
                #  with account uuid

                self._clients[clientuuid] = Client(
                    sock=sock,
                    ip=ip,
                    clientuuid=clientuuid,
                )

                self.log("Client connected:", clientuuid, lvl=debug)
            else:
                self.log("Old IP reconnected!", lvl=warn)
                #     self.fireEvent(write(sock, "Another client is
                # connecting from your IP!"))
                #     self._sockets[sock] = (ip, uuid.uuid4())
        except Exception as e:
            self.log("Error during connect: ", e, type(e), lvl=critical)
1353287
def connect(self):
        """"""
        try:
            context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
            if self.config['no_ssl_verify']:
                requests.packages.urllib3.disable_warnings()
                context.verify_mode = ssl.CERT_NONE
                self.si = SmartConnectNoSSL(
                    host=self.config['server'],
                    user=self.config['username'],
                    pwd=self.config['password'],
                    port=int(self.config['port']),
                    certFile=None,
                    keyFile=None,
                )
            else:
                self.si = SmartConnect(
                    host=self.config['server'],
                    user=self.config['username'],
                    pwd=self.config['password'],
                    port=int(self.config['port']),
                    sslContext=context,
                    certFile=None,
                    keyFile=None,
                )
        except Exception as e:
            print('Unable to connect to vsphere server.')
            print(e)
            sys.exit(1)

        # add a clean up routine
        atexit.register(Disconnect, self.si)

        self.content = self.si.RetrieveContent()