Connects this object to the specified source project.
1455
def load(self, project: typing.Union[projects.Project, None]):
        """"""
        self._project = project
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()
225297
private void connect() throws IOException {

	client = AFTPClient.getInstance(conn.secure(), address, conn.getPort(), conn.getUsername(), conn.getPassword(), conn.getFingerprint(), conn.getStopOnError());

	if (client instanceof SFTPClientImpl && conn.getKey() != null) {
	    ((SFTPClientImpl) client).setSshKey(conn.getKey(), conn.getPassphrase());
	}

	setConnectionSettings(client, conn);

	// transfer mode
	if (conn.getTransferMode() == FTPConstant.TRANSFER_MODE_ASCCI) getClient().setFileType(FTP.ASCII_FILE_TYPE);
	else if (conn.getTransferMode() == FTPConstant.TRANSFER_MODE_BINARY) getClient().setFileType(FTP.BINARY_FILE_TYPE);

	// Connect
	try {
	    Proxy.start(conn.getProxyServer(), conn.getProxyPort(), conn.getProxyUser(), conn.getProxyPassword());
	    client.connect();
	}
	finally {
	    Proxy.end();
	}
    }
371383
@Override
  public void connect(
      ChannelHandlerContext ctx,
      SocketAddress remoteAddress,
      SocketAddress localAddress,
      ChannelPromise promise) throws Exception {
    final class ConnectListener implements ChannelFutureListener {
      @Override
      public void operationComplete(ChannelFuture future) {
        if (!future.isSuccess()) {
          failWrites(future.cause());
        }
      }
    }

    super.connect(ctx, remoteAddress, localAddress, promise);
    promise.addListener(new ConnectListener());
  }
915547
def connect(workbench):
    
    d = _getContextFactory(getDataPath(), workbench)
    d.addCallback(_connectWithContextFactory, workbench)
    return d
154994
public void addSource(String source)
    {
        if(this.sources == null)
            this.sources = new ArrayList<String>();
        this.sources.add(source);
    }
1113774
@Override
    public void connect(String server, int port, String application, IPendingServiceCallback connectCallback) {
        log.debug("connect server: {} port {} application {} connectCallback {}", new Object[] { server, port, application, connectCallback });
        connect(server, port, makeDefaultConnectionParams(server, port, application), connectCallback);
    }
712502
def connect(self, event, handler):
        """"""
        interface = self._proxy.get_interface_name()
        return self.object.connect(interface, event, handler)
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()
1323117
function Connect(project, env, bundle) {

    var self = this;
    var reserved = [ 'framework' ];
    self.task = 'connect';//important for later in config init
    self.env = env;

    //this.init = this.onInitialize = function (cb) {
    //    if (self.initialized == undefined) {
    //        self.initialized = true;
    //        if (typeof(cb) != 'undefined' && typeof(cb) == 'function') {
    //            cb(init)
    //        } else {
    //            init()
    //        }
    //    }
    //
    //    return self
    //}
    //
    //var init = function() {
    //    if ( reserved.indexOf(bundle) > -1 ) {
    //        console.log('[ '+bundle+' ] is a reserved name. Please, try something else.');
    //        process.exit(1)
    //    }
    //    self.root = getPath('root');
    //
    //    try {
    //        self.project = project;
    //        self.projectData = require(project);
    //
    //        if ( !fs.existsSync(env) ) {
    //            fs.writeFileSync(env, '{}')
    //        }
    //        self.envData = require(env);
    //
    //        self.bundle = bundle;
    //
    //        console.info('removing ', bundle);
    //
    //        // TODO - Prompt if user want to erase related releases if exist
    //        var projectObj = require(self.project);
    //        var linkPath = new _(_(self.root +'/'+ projectObj.bundles[self.bundle].release.link));
    //        if ( fs.existsSync(linkPath.toString()) ) {
    //            linkPath.rm(function onLinkDeleted(err) {
    //                if (err) {
    //                    console.error(err.stack||err.message);
    //                    process.exit(1)
    //                } else {
    //                    deleteBundle()
    //                }
    //            })
    //        } else {
    //            deleteBundle()
    //        }
    //
    //    } catch (err) {
    //        console.error(err.stack);
    //        process.exit(1)
    //    }
    //}
    //
    //var deleteSources = function() {
    //    if (fs.existsSync(_(self.root+'/src/'+self.bundle))) {
    //
    //        var bundlePath = new _(self.root+'/src/'+self.bundle);
    //        bundlePath.rm( function bundleRemoved (err) {
    //            if (err) {
    //                console.log(err.stack);
    //                process.exit(1)
    //            }
    //            console.log('Bundle [ '+bundle+' ] has been removed from your project with success.');
    //            self.emit('delete#complete', err)
    //        })
    //    } else {
    //        console.log('Bundle [ '+bundle+' ] has been removed from your project with success.');
    //        self.emit('delete#complete', err)
    //    }
    //}
    //
    //var deleteBundle = function() {
    //
    //    var config = new Config({
    //        env             : process.env.NODE_ENV,
    //        executionPath   : self.root,
    //        startingApp     : self.bundle,
    //        ginaPath       : GINA_PATH,
    //        task            : self.task
    //    });
    //
    //    config.onReady( function onConfigReady(err, obj) {
    //
    //        self.conf = obj.conf[bundle][process.env.NODE_ENV];
    //
    //        removeFromLogs( function logsRemoved (err) {
    //            if (err) {
    //                console.error(err.stack);
    //                process.exit(1)
    //            }
    //            cleanFile( function logsRemoved (err) {
    //                if (err) {
    //                    console.error(err.stack);
    //                    process.exit(1)
    //                }
    //
    //                if (
    //                    typeof(self.conf['releases'] != undefined)
    //                    && fs.existsSync(_(self.conf.releases +'/'+ bundle))
    //                ) {
    //                    var relPath = new _(self.conf.releases +'/'+ bundle);
    //                    relPath.rm( function bundleRemoved (err) {
    //                        if (err) {
    //                            console.log(err.stack);
    //                            process.exit(1)
    //                        }
    //                        console.log('Bundle release for [ '+bundle+' ] has been removed from your project with success.');
    //                        deleteSources()
    //                    })
    //                } else {
    //                    // deleting soruces
    //                    deleteSources()
    //                }
    //            })
    //        })
    //    })//EO config.onReady
    //}
    //
    //var cleanFile = function(callback) {
    //    try {
    //        if ( typeof(self.envData[self.bundle]) != 'undefined' ) {
    //            delete(self.envData[self.bundle]);
    //            fs.writeFileSync(self.env, JSON.stringify(self.envData, null, 4))
    //        }
    //        if ( typeof(self.projectData.bundles[self.bundle]) != 'undefined' ) {
    //            delete(self.projectData.bundles[self.bundle]);
    //            fs.writeFileSync(self.project, JSON.stringify(self.projectData, null, 4))
    //        }
    //        callback()
    //    } catch (err) {
    //        callback(err)
    //    }
    //}
    //
    //var removeFromLogs = function(callback) {
    //    var logsPath = _(self.root+'/logs/'+self.bundle);
    //
    //    if ( fs.existsSync(logsPath) ) {
    //        logsPath = new _(self.root+'/logs/'+self.bundle);
    //        logsPath.rm( function logsRemoved (err) {
    //            callback(err)
    //        })
    //    } else {
    //        callback()
    //    }
    //}
    //
    //this.onComplete = function(callback) {
    //    self.once('delete#complete', function(err) {
    //        callback(err)
    //    })
    //    return self
    //}
}
624740
private void doConnect(){
        task = new SocketDeamonTask();
        connectThread = new Thread(task);
        connectThread.setDaemon(true);
        connectThread.start();
    }
216143
public void importResourceAll() {

        try {
            importResource();
            importAccessControlEntries();
            increaseCounter();
        } finally {
            m_destination = null;
            m_source = null;
            m_throwable = null;
            m_properties = null;
            m_aces = null;
        }
    }
383098
public void connectServer(Connection connection) {
    threadContext.checkThread();

    // Handlers for all request types are registered since requests can be proxied between servers.
    // Note we do not use method references here because the "state" variable changes over time.
    // We have to use lambdas to ensure the request handler points to the current state.
    connection.handler(RegisterRequest.class, (Function<RegisterRequest, CompletableFuture<RegisterResponse>>) request -> state.register(request));
    connection.handler(ConnectRequest.class, (Function<ConnectRequest, CompletableFuture<ConnectResponse>>) request -> state.connect(request, connection));
    connection.handler(KeepAliveRequest.class, (Function<KeepAliveRequest, CompletableFuture<KeepAliveResponse>>) request -> state.keepAlive(request));
    connection.handler(UnregisterRequest.class, (Function<UnregisterRequest, CompletableFuture<UnregisterResponse>>) request -> state.unregister(request));
    connection.handler(ResetRequest.class, (Consumer<ResetRequest>) request -> state.reset(request));
    connection.handler(ConfigureRequest.class, (Function<ConfigureRequest, CompletableFuture<ConfigureResponse>>) request -> state.configure(request));
    connection.handler(InstallRequest.class, (Function<InstallRequest, CompletableFuture<InstallResponse>>) request -> state.install(request));
    connection.handler(JoinRequest.class, (Function<JoinRequest, CompletableFuture<JoinResponse>>) request -> state.join(request));
    connection.handler(ReconfigureRequest.class, (Function<ReconfigureRequest, CompletableFuture<ReconfigureResponse>>) request -> state.reconfigure(request));
    connection.handler(LeaveRequest.class, (Function<LeaveRequest, CompletableFuture<LeaveResponse>>) request -> state.leave(request));
    connection.handler(AppendRequest.class, (Function<AppendRequest, CompletableFuture<AppendResponse>>) request -> state.append(request));
    connection.handler(PollRequest.class, (Function<PollRequest, CompletableFuture<PollResponse>>) request -> state.poll(request));
    connection.handler(VoteRequest.class, (Function<VoteRequest, CompletableFuture<VoteResponse>>) request -> state.vote(request));
    connection.handler(CommandRequest.class, (Function<CommandRequest, CompletableFuture<CommandResponse>>) request -> state.command(request));
    connection.handler(QueryRequest.class, (Function<QueryRequest, CompletableFuture<QueryResponse>>) request -> state.query(request));

    connection.onClose(stateMachine.executor().context().sessions()::unregisterConnection);
  }
460640
async def _connect(self, hostname, port, reconnect=False, channels=[],
                       encoding=protocol.DEFAULT_ENCODING, source_address=None):
        
        # Create connection if we can't reuse it.
        if not reconnect or not self.connection:
            self._autojoin_channels = channels
            self.connection = connection.Connection(hostname, port, source_address=source_address,
                                                    eventloop=self.eventloop)
            self.encoding = encoding

        # Connect.
        await self.connection.connect()
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)
163280
def connect(self, source, target, witnesses):
        
        # print("Adding Edge: "+source+":"+target)
        if self.graph.has_edge(source, target):
            self.graph[source][target]["label"] += ", " + str(witnesses)
        else:
            self.graph.add_edge(source, target, label=witnesses)
291363
void becomeConnected(Sink sink, Socket socket) {
    checkState(this.sink == null, "AsyncSink's becomeConnected should only be called once.");
    this.sink = checkNotNull(sink, "sink");
    this.socket = checkNotNull(socket, "socket");
  }