Connects to the manager.
8948
def _connect(self):
        """"""
        cls = self._get_manager_class(register_callables=False)
        ins = cls(address=self.addr, authkey=self.authkey)
        ins.connect()
        return ins
628351
def _connect(self):
        """"""
        try:
            if sys.version_info[:2] >= (2,6):
                self._conn = telnetlib.Telnet(self._amihost, self._amiport, 
                                              connTimeout)
            else:
                self._conn = telnetlib.Telnet(self._amihost, self._amiport)
        except:
            raise Exception(
                "Connection to Asterisk Manager Interface on "
                "host %s and port %s failed."
                % (self._amihost, self._amiport)
                )
1319878
def connect_target(target_host, reporter)
      connect_message = T.status.connecting(target_host.user)
      reporter.update(connect_message)
      do_connect(target_host, reporter)
    end
1064291
def _handle_eio_connect(self, sid, environ):
        """"""
        if not self.manager_initialized:
            self.manager_initialized = True
            self.manager.initialize()
        self.environ[sid] = environ
        return self._handle_connect(sid, '/')
790497
private boolean connect() {
        if (this.factory == null) {
            return false;
        }
        
        if (isConnected()) {
            return true;
        }
        
        try {
            this.connection = this.factory.createConnection();
            this.session = (TopicSession) this.connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            this.connection.start();
            return true;
        } catch (Exception e) {
            log.error("Error communicating with JMS server: " + e.getMessage());
            disconnect();
            return false;
        }
    }
776232
public function connect() {
		if (isset($this->handle) && $this->handle != null) {
			$this->close();
		}
		
		$this->parseConnectionString();
		$this->handle = \Yii::createObject($this->driverOptions);
		$this->handle->connect();
		$this->onConnectionOpen(new Event(['sender' => $this]));
	}
169865
function Manager (remote) {

	/** Allow usage without `new`. */
	if (!(this instanceof Manager)) {
		return new Manager(remote);
	}

	/**
	 * @property {Boolean} isRemote
	 * Whether the manager is remote.
	 */
	this.isRemote = false;

	/**
	 * @property {Socket} socket
	 * A socket.io instance, or `null` if using locally.
	 */
	this.socket = null;

	/** If only using locally, stop here. */
	if (!remote) {
		return this;
	}

	/** If it's a URL, connect to it. */
	if (typeof remote === 'string') {
		this.isRemote = true;

		/** Automatically postfix the manager scope. */
		var url = remote + '/panic-manager';

		/** Connect to the remote manager. */
		this.socket = socket.client(url);

		return this;
	}

	/** Listen for /panic-manager connections. */
	var server = socket.server(remote).of('/panic-manager');

	/** Listen for connections. */
	server.on('connection', function (socket) {

		/** Listen for start commands. */
		socket.on('start', function (config) {
			spawn(config);
		});

	});

	this.socket = server;

}
1364308
def connect(self):
        
        self.client = BaitTelnetClient(self.options['server'], self.options['port'])
        self.client.set_option_negotiation_callback(self.process_options)
79195
async def do_connect(self, args):
        
        params = args.split()
        device = '/dev/ttyUSB0'
        workdir = None

        try:
            device = params[0]
        except IndexError:
            if self.tools.device:
                device = self.tools.device
        try:
            workdir = params[1]
        except IndexError:
            if self.tools.workdir:
                workdir = self.tools.workdir

        if device:
            await self.tools.connect(False, device=device, workdir=workdir)
        _LOGGING.info('Connection complete.')
753949
public function enable()
    {
        $this->manager->enable($this);

        if ($this->referenced) {
            $this->manager->reference($this);
        }
    }
832032
def connect(self, action=None, method=None, **kwargs):
        
        return self.nest(Connect(action=action, method=method, **kwargs))
1291490
public function manager()
    {
        if (!isset($this->manager)) {
            $this->manager = new Manager($this->client);
        }

        return $this->manager;
    }
624740
private void doConnect(){
        task = new SocketDeamonTask();
        connectThread = new Thread(task);
        connectThread.setDaemon(true);
        connectThread.start();
    }
242891
def connect(self):
    """"""
    if self._connected or self.is_alive():
      raise ConnectionExistsError("Already connected")
    # After starting the thread we wait for it to post us
    # an event signifying that connection is established. This
    # ensures that the caller only resumes when we are fully connected.
    self.start()
    with self._lock:
      self._connect_cond.wait_for(lambda: self._connected)
873138
def connect(self):
        
        ctx = Context(self.module, self.create_mediator())
        ctx.logger = self.logger
        ctx.default_factory = self.default_factory
        return ctx
586120
def open(self, callback):
        
        if self.is_active:
            raise ValueError("This manager is already open.")

        if self._closed:
            raise ValueError("This manager has been closed and can not be re-used.")

        self._callback = functools.partial(_wrap_callback_errors, callback)

        # Create the RPC
        self._rpc = bidi.ResumableBidiRpc(
            start_rpc=self._client.api.streaming_pull,
            initial_request=self._get_initial_request,
            should_recover=self._should_recover,
        )
        self._rpc.add_done_callback(self._on_rpc_done)

        # Create references to threads
        self._dispatcher = dispatcher.Dispatcher(self, self._scheduler.queue)
        self._consumer = bidi.BackgroundConsumer(self._rpc, self._on_response)
        self._leaser = leaser.Leaser(self)
        self._heartbeater = heartbeater.Heartbeater(self)

        # Start the thread to pass the requests.
        self._dispatcher.start()

        # Start consuming messages.
        self._consumer.start()

        # Start the lease maintainer thread.
        self._leaser.start()

        # Start the stream heartbeater thread.
        self._heartbeater.start()
396774
def admin(self):
        """"""
        if self._securityHandler is None:
            raise Exception("Cannot connect to adminstrative server without authentication")
        from ..manageags import AGSAdministration
        return AGSAdministration(url=self._adminUrl,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port,
                                 initialize=False)