:meth:`.WNetworkClientProto.connect` method implementation
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
1074316
def connect(cls, *args, **kwargs):
        
        loop = kwargs.get('loop')
        if loop is None:
            loop = trollius.get_event_loop()
        future = trollius.Future(loop=loop)

        def callback(arg):
            if not future.done():
                if isinstance(arg, Exception):
                    loop.call_soon_threadsafe(future.set_exception, arg)
                else:
                    loop.call_soon_threadsafe(future.set_result, arg)

        stream = cls(callback, *args, **kwargs)
        yield From(future)
        raise Return(stream)
1199050
def connect(url, prefix=None, **kwargs):
    
    return connection(url, prefix=get_prefix(prefix), **kwargs)
1107279
async def create_connection(
    host,
    port,
    *,
    loop=None,
    secure=True,
    ssl_context=None,
    **kwargs,
):
    
    loop = loop or asyncio.get_event_loop()

    secure = True if port == 443 else secure
    connection = HTTP2ClientConnection(host, loop=loop, secure=secure)
    if not isinstance(ssl_context, SSLContext):
        ssl_context = default_ssl_context()

    await loop.create_connection(
        lambda: connection,
        host=host,
        port=port,
        ssl=ssl_context,
    )

    return connection
595606
def connect(token, protocol=RtmProtocol, factory=WebSocketClientFactory, factory_kwargs=None, api_url=None, debug=False):
	
	if factory_kwargs is None:
		factory_kwargs = dict()

	metadata = request_session(token, api_url)
	wsfactory = factory(metadata.url, **factory_kwargs)
	if debug:
		warnings.warn('debug=True has been deprecated in autobahn 0.14.0')

	wsfactory.protocol = lambda *a,**k: protocol(*a,**k)._seedMetadata(metadata)
	connection = connectWS(wsfactory)
	return connection
726046
private void _connect() throws IOException {
        curatorFramework = CuratorFrameworkFactory.newClient(connectString, sessionTimeout, 5000,
                new RetryNTimes(3, 2000));
        curatorFramework.start();
    }
1222379
def _connect(self):
        '''
        
        '''
        while True:
            if self._closing:
                break
            try:
                kwargs = {}
                if self.source_ip or self.source_port:
                    if tornado.version_info >= (4, 5):
                        ### source_ip and source_port are supported only in Tornado >= 4.5
                        # See http://www.tornadoweb.org/en/stable/releases/v4.5.0.html
                        # Otherwise will just ignore these args
                        kwargs = {'source_ip': self.source_ip,
                                  'source_port': self.source_port}
                    else:
                        log.warning('If you need a certain source IP/port, consider upgrading Tornado >= 4.5')
                with salt.utils.asynchronous.current_ioloop(self.io_loop):
                    self._stream = yield self._tcp_client.connect(self.host,
                                                                  self.port,
                                                                  ssl_options=self.opts.get('ssl'),
                                                                  **kwargs)
                self._connecting_future.set_result(True)
                break
            except Exception as e:
                yield tornado.gen.sleep(1)
749305
def connect_client(ws)
      actor = Actor.current

      # run the blocking websocket client connect+read in a separate thread
      defer {
        ws.on_pong do |delay|
          # XXX: called with the client mutex locked, do not block
          actor.async.on_pong(delay)
        end

        # blocks until open, raises on errors
        ws.connect

        # These are called from the read_ws -> defer thread, proxy back to actor
        actor.on_open

        ws.read do |message|
          actor.on_message(message)
        end
      }

    rescue Kontena::Websocket::CloseError => exc
      # server closed connection
      on_close(exc.code, exc.reason)
      disconnected!

    rescue Kontena::Websocket::Error => exc
      # handle known errors, will reconnect or shutdown
      on_error exc
      disconnected!

    rescue => exc
      # XXX: crash instead of reconnecting on unknown errors?
      error exc
      disconnected!

    else
      # impossible: agent closed connection?!
      info "Agent closed connection with code #{ws.close_code}: #{ws.close_reason}"
      disconnected!

    ensure
      ws.disconnect # close socket
    end
871134
async def connect(self):
        '''
        '''
        assert not self.closed
        connection = await self._get()
        return PoolConnection(self, connection)
974705
def connect(self, url):
        

        headers = httputil.HTTPHeaders({'Content-Type': APPLICATION_JSON})
        request = httpclient.HTTPRequest(url=url,
                                         connect_timeout=self.connect_timeout,
                                         request_timeout=self.request_timeout,
                                         headers=headers)
        ws = websocket_connect(url)
        ws.add_done_callback(self._connect_callback)
280045
def eventsource_connect(url, io_loop=None, callback=None, connect_timeout=None):
    
    if io_loop is None:
        io_loop = IOLoop.current()
    if isinstance(url, httpclient.HTTPRequest):
        assert connect_timeout is None
        request = url
        # Copy and convert the headers dict/object (see comments in
        # AsyncHTTPClient.fetch)
        request.headers = httputil.HTTPHeaders(request.headers)
    else:
        request = httpclient.HTTPRequest(
            url,
            connect_timeout=connect_timeout,
            headers=httputil.HTTPHeaders({
                "Accept-Encoding": "identity"
            })
        )
    request = httpclient._RequestProxy(
        request, httpclient.HTTPRequest._DEFAULTS)
    conn = EventSourceClient(io_loop, request)
    if callback is not None:
        io_loop.add_future(conn.connect_future, callback)
    return conn.connect_future
33561
def connect(self):
        
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        try:
            self.socket.connect((self.host, self.port))
        except socket.error as (err, msg):
            self.connected = False
            raise ScratchError("[Errno %d] %s" % (err, msg))
        self.connected = True
674053
def connect(self, username=None, passcode=None, wait=False, headers=None, **keyword_headers):
        
        self.transport.start()
1151151
function connect() {
    if (!redis) {
      debug('createClient ' + key + ' at ' + host + ':' + port);
      redis = redisLib.createClient(port, host, redisOpts); }
  }
166581
def connect(self):
        '''
        
        '''
        if self.connected:
            raise RuntimeError(
                '{} is connected already'.format(self.__class__.__name__))
        if self.closed:
            raise RuntimeError(
                '{} is closed already'.format(self.__class__.__name__))
        self.connected = True
        self._connect()
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)
1154222
async def connect_message(self, message, context):
        
        conn_string = message.get('connection_string')
        client_id = context.user_data

        await self.connect(client_id, conn_string)