Establish a connection to AdobeConnect's server
771600
public function connect()
    {
        if (! $this->getCookie()) {
            $response = $this->doRequest('common-info');

            $this->setCookie($response->getXmlResponse()->common->cookie);
        }

        $this->connected = true;
    }
673533
def _connect(self):
        """"""
        if sys.version_info[:2] < (2,6):
            self._conn = httplib.HTTPConnection(self._host, self._port)
        else:
            self._conn = httplib.HTTPConnection(self._host, self._port, 
                                                False, defaultTimeout)
164454
void connect(boolean reconnectOnConnect) throws InterruptedException, IOException {
        if (options.getServers().size() == 0) {
            throw new IllegalArgumentException("No servers provided in options");
        }

        for (String serverURI : getServers()) {

            if (isClosed()) {
                break;
            }

            updateStatus(Status.CONNECTING);

            tryToConnect(serverURI);

            if (isConnected()) {
                break;
            } else {
                updateStatus(Status.DISCONNECTED);
            }
        }

        if (!isConnected() && !isClosed()) {
            if (reconnectOnConnect) {
                reconnect();
            } else {
                close();
                throw new IOException("Unable to connect to gnatsd server.");
            }
        }
    }
630956
def connect(ipAddr, port, password):
    """"""

    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.connect((ipAddr, port))
    sock.settimeout(2)

    # Make sure it pongs.
    sock.send(b'd1:q4:pinge')
    data = sock.recv(BUFFER_SIZE)
    if not data.endswith(b'1:q4:ponge'):
        raise exceptions.NotACjdnsAdminSocket("Looks like %s:%d is to a non-cjdns socket.",
                                              (ipAddr, port))

    # Get the functions and make the object
    page = 0
    availableFunctions = {}
    while True:
        sock.send(bytearray(
            'd1:q24:Admin_availableFunctions4:argsd4:pagei%seee' % page,
            'utf-8'))
        data = sock.recv(BUFFER_SIZE)
        benc = bdecode(data)
        for func in benc['availableFunctions']:
            availableFunctions[func] = benc['availableFunctions'][func]
        if 'more' not in benc:
            break
        page = page+1

    funcArgs = {}
    funcOargs = {}

    for (i, func) in availableFunctions.items():
        items = func.items()

        # grab all the required args first
        # append all the optional args
        rargList = [arg for arg, atts in items if atts['required']]
        argList = rargList + [
            arg for arg, atts in items if not atts['required']]

        # for each optional arg setup a default value with
        # a type which will be ignored by the core.
        oargList = {}
        for (arg, atts) in items:
            if not atts['required']:
                oargList[arg] = (
                    "''" if func[arg]['type'] == 'Int'
                    else "")

        setattr(Session, i, _functionFabric(
            i, argList, oargList, password))

        funcArgs[i] = rargList
        funcOargs[i] = oargList

    session = Session(sock)

    kat = threading.Thread(target=_receiverThread, args=[session])
    kat.setDaemon(True)
    kat.start()

    # Check our password.
    ret = _callFunc(session, "ping", password, {})
    if 'error' in ret:
        raise exceptions.InvalidAdminPassword(ret.get("error"))

    session._functions = ""

    funcOargs_c = {}
    for func in funcOargs:
        funcOargs_c[func] = list([
            key + "=" + str(value) for (key, value) in funcOargs[func].items()
        ])

    for func in availableFunctions:
        session._functions += (
            func + "(" + ', '.join(funcArgs[func] + funcOargs_c[func]) + ")\n")

    return session
116224
async def connect(self):
        
        await self._sender.connect(self._connection(
            self.session.server_address,
            self.session.port,
            self.session.dc_id,
            loop=self._loop,
            loggers=self._log,
            proxy=self._proxy
        ))
        self.session.auth_key = self._sender.auth_key
        self.session.save()

        await self._sender.send(self._init_with(
            functions.help.GetConfigRequest()))

        self._updates_handle = self._loop.create_task(self._update_loop())
264864
def connect(self):
        """"""
        if not self.connected:
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.socket.connect(self.address)
            self.connected = True
1333707
function connect() {
  console.log('Connecting client: ' + clientId + ' to url:"' + url + '"');
  client = mqtt.connect(url, { 'clientId': clientId });
}
168661
def connect(self):
		
		exceptions = list(__basic_ftp_exceptions__)
		exceptions.append(OSError)  # OSError for "no route to host" issue
		exceptions.append(ConnectionRefusedError)  # for unavailable service on a host

		try:
			self.ftp_client().connect(**self.__ftp_connect_args)
			self.ftp_client().login(**self.__ftp_auth_args)
		except tuple(exceptions) as e:
			raise WClientConnectionError('Unable to connect to the server') from e
		try:
			path = self.uri().path()
			if path is None:
				path = self.directory_sep()
			self.change_directory(path)
		except WClientCapabilityError as e:
			raise WClientConnectionError(
				'Unable to change current working directory to the specified one'
			) from e
755846
def connect(creds):
    
    return swiftclient.Connection(
        authurl=creds.authurl,
        user=creds.user,
        key=creds.password,
        auth_version=creds.auth_version,
        tenant_name=creds.tenant_name,
        os_options={
            "region_name": creds.region,
            "endpoint_type": creds.endpoint_type,
            "domain_id": creds.domain_id,
            "domain_name": creds.domain_name,
            "tenant_id": creds.tenant_id,
            "user_id": creds.user_id,
            "user_domain_id": creds.user_domain_id,
            "user_domain_name": creds.user_domain_name,
            "project_id": creds.project_id,
            "project_name": creds.project_name,
            "project_domain_id": creds.project_domain_id,
            "project_domain_name": creds.project_domain_name,
        }
    )
874670
def connect(self):
        '''  '''
        # open config file for parsing
        try:
            settings = configparser.ConfigParser()
            settings._interpolation = configparser.ExtendedInterpolation()
        except Exception as err:
            self.logger.error("Failed to instantiate config parser exception: %s" % err)
            raise
        try:
            settings.read(self.__config__)
        except Exception as err:
            self.logger.error("Failed to read config file exception: %s" % err)
            raise

        # Connect to Symphony
        symphony_p12 = settings.get('symphony', 'symphony_p12')
        symphony_pwd = settings.get('symphony', 'symphony_pwd')
        symphony_pod_uri = settings.get('symphony', 'symphony_pod_uri')
        symphony_keymanager_uri = settings.get('symphony', 'symphony_keymanager_uri')
        symphony_agent_uri = settings.get('symphony', 'symphony_agent_uri')
        symphony_sessionauth_uri = settings.get('symphony', 'symphony_sessionauth_uri')
        symphony_sid = settings.get('symphony', 'symphony_sid')
        crypt = symphony.Crypt(symphony_p12, symphony_pwd)
        symphony_crt, symphony_key = crypt.p12parse()

        try:
            # instantiate auth methods
            auth = symphony.Auth(symphony_sessionauth_uri, symphony_keymanager_uri, symphony_crt, symphony_key)
            # get session token
            session_token = auth.get_session_token()
            self.logger.info("AUTH ( session token ): %s" % session_token)
            # get keymanager token
            keymngr_token = auth.get_keymanager_token()
            self.logger.info("AUTH ( key manager token ): %s" % keymngr_token)
            # instantiate agent methods
            agent = symphony.Agent(symphony_agent_uri, session_token, keymngr_token)
            # instantiate pod methods
            pod = symphony.Pod(symphony_pod_uri, session_token, keymngr_token)

            self.logger.info("INSTANTIATION ( all objects successful)")
        except Exception as err:
            self.logger.error("Failed to authenticate and initialize: %s" % err)
            raise
        # return references and such
        return agent, pod, symphony_sid
1363949
def connect(self, protocol=None):
        """"""
        # Convert protocol to port enum.
        if protocol is not None:
            port = self.PORT_MAP[protocol]
        else:
            port = DAPAccess.PORT.DEFAULT
        
        try:
            self._link.connect(port)
        except DAPAccess.Error as exc:
            six.raise_from(self._convert_exception(exc), exc)
        
        # Read the current mode and save it.
        actualMode = self._link.get_swj_mode()
        self._protocol = self.PORT_MAP[actualMode]
        
        self._invalidate_cached_registers()
940097
function TcpStreamConnect () {
        this.simulator.Debug (3, 'Dispatcher connected to %s:%s', simulator.opts.host, simulator.opts.port);
        ActiveClients[this] = this;  // register on remote server in active socket list
    }
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))
1100206
public function connect()
    {
        /*
         The Server MUST process a second CONNECT Packet sent from a Client as a protocol violation
         and disconnect the Client [MQTT-3.1.0-2]

         So CONNECT SHOULD be a blocking connection.
         */

        $connect_retry_count = 0;
        $max_connect_retry_count = 10;
        do {
            $r = $this->socket->connect();
            if ($r) {
                break;
            }

            if (++$connect_retry_count > $max_connect_retry_count) {
                throw new Exception\ConnectError('Failed to connect to ' . $this->socket->getAddress());
            }
        } while (true);

        Debug::Log(Debug::INFO, 'connect(): Connection established.');

        $this->socket->set_blocking();

        /**
         * @var Message\CONNECT $connectobj
         */
        $connectobj = $this->getMessageObject(Message::CONNECT);

        if (!$this->connect_clean && empty($this->clientid)) {
            throw new Exception('Client id must be provided if Clean Session flag is set false.');
        }

        # default client id
        if (empty($this->clientid)) {
            $this->clientid = 'mqtt'.substr(md5(uniqid('mqtt', true)), 8, 16);
        }
        Debug::Log(Debug::DEBUG, 'connect(): clientid=' . $this->clientid);

        $connectobj->setKeepalive($this->keepalive);
        Debug::Log(Debug::DEBUG, 'connect(): keepalive=' . $this->keepalive);

        $connectobj->setAuth($this->username, $this->password);
        Debug::Log(Debug::DEBUG, 'connect(): username=' . $this->username . ' password=' . $this->password);

        $connectobj->setClean($this->connect_clean);

        if ($this->connect_will instanceof Will) {
            $connectobj->setWill($this->connect_will);
        }

        $length = 0;

        $bytes_written = $this->message_write($connectobj, $length);
        Debug::Log(Debug::DEBUG, 'connect(): bytes written=' . $bytes_written);

        /**
         * @var Message\CONNACK $connackobj
         */
        $connackobj = null;

        $connackobj = $this->message_read();

        Debug::Log(Debug::INFO, 'connect(): connected=' . ($connackobj->getMessageType() == Message::CONNACK ? 1 : 0));

        # save current time for ping
        $this->connected_time = time();

        # Call connect
        $this->call_handler('connack', array($this, $connackobj));

        return $connackobj;
    }
683806
function(callback) {
      self._getConnection(function(err, connection) {
        if (err) {
          callback(new Error('Unable to establish connection with the master ' +
                             'process'));
          return;
        }

        self._connection = connection;
        callback();
      });
    }
256132
def _connect(self):
        """"""
        try:
            while True:
                _LOGGER.info('Trying to connect to %s', self.server_address)
                try:
                    yield from asyncio.wait_for(
                        self.loop.create_connection(
                            lambda: self.protocol, *self.server_address),
                        self.reconnect_timeout, loop=self.loop)
                    self.tcp_check_timer = time.time()
                    self.tcp_disconnect_timer = time.time()
                    self._check_connection()
                    return
                except asyncio.TimeoutError:
                    _LOGGER.error(
                        'Connecting to socket timed out for %s',
                        self.server_address)
                    _LOGGER.info(
                        'Waiting %s secs before trying to connect again',
                        self.reconnect_timeout)
                    yield from asyncio.sleep(
                        self.reconnect_timeout, loop=self.loop)
                except OSError:
                    _LOGGER.error(
                        'Failed to connect to socket at %s',
                        self.server_address)
                    _LOGGER.info(
                        'Waiting %s secs before trying to connect again',
                        self.reconnect_timeout)
                    yield from asyncio.sleep(
                        self.reconnect_timeout, loop=self.loop)
        except asyncio.CancelledError:
            _LOGGER.debug(
                'Connect attempt to %s cancelled', self.server_address)
864392
private void doConnect() {
        try {
            LOG.info("Connecting to zookeeper server - " + RpcClientConf.ZK_SERVER_LIST);
            zkClient = new SimpleZooKeeperClient(RpcClientConf.ZK_SERVER_LIST,
                    RpcClientConf.ZK_DIGEST_AUTH, new ServiceWatcher());
            updateServiceLocalCache();
        } catch (Exception e) {
            LOG.error("Zookeeper client initialization failed, " + e.getMessage(), e);
        }
    }