Connects via a RS-485 to Ethernet adapter.
541321
def connect(self, host, port):
        """"""
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.connect((host, port))
        self._reader = sock.makefile(mode='rb')
        self._writer = sock.makefile(mode='wb')
1297421
def connect(self):
        """"""
        self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self._socket.settimeout(self._connect_timeout)
        SocketError.wrap(self._socket.connect, (self.host, self.port))
        self._socket.settimeout(None)
        self._socket_file = self._socket.makefile('rb')
555554
def connect(self, protocol=None, mode=None, disposition=None):
        """"""
        self.component.connect(protocol, mode, disposition)
222190
def _connect_remote(self, host, host_port, lan_ports, race, name, map_inst,
                      save_map, interface):
    """"""
    # Connect!
    logging.info("Connecting...")
    self._controllers = [remote_controller.RemoteController(host, host_port)]
    logging.info("Connected")

    if map_inst and save_map:
      run_config = run_configs.get()
      self._controllers[0].save_map(map_inst.path, map_inst.data(run_config))

    # Create the join request.
    join = sc_pb.RequestJoinGame(options=interface)
    join.race = race
    join.player_name = name
    join.shared_port = 0  # unused
    join.server_ports.game_port = lan_ports.pop(0)
    join.server_ports.base_port = lan_ports.pop(0)
    join.client_ports.add(
        game_port=lan_ports.pop(0), base_port=lan_ports.pop(0))

    logging.info("Joining game.")
    self._controllers[0].join_game(join)
    self._in_game = True
    logging.info("Game joined.")
1188738
def _do_connect(self):
        """"""
        _, self._protocol = yield from self._loop.create_connection(
            lambda: SnapcastProtocol(self._callbacks), self._host, self._port)
892339
def connect(self):
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(("127.0.0.1", self._port))
    return sock
111393
def _connect(self):
        
        # the following call raises a RoasterLookupException when the device
        # is not found. It is
        port = utils.find_device('1A86:5523')
        # on some systems, after the device port is added to the device list,
        # it can take up to 20 seconds after USB insertion for
        # the port to become available... (!)
        # let's put a safety timeout in here as a precaution
        wait_timeout = time.time() + 40.0  # should be PLENTY of time!
        # let's update the _connect_state while we're at it...
        self._connect_state.value = self.CS_CONNECTING
        connect_success = False
        while time.time() < wait_timeout:
            try:
                self._ser = serial.Serial(
                    port=port,
                    baudrate=9600,
                    bytesize=8,
                    parity='N',
                    stopbits=1.5,
                    timeout=0.25,
                    xonxoff=False,
                    rtscts=False,
                    dsrdtr=False)
                connect_success = True
                break
            except serial.SerialException:
                time.sleep(0.5)
        if not connect_success:
            # timeout on attempts
            raise exceptions.RoasterLookupError

        self._initialize()
1270304
def ethernet_adapters(self, ethernet_adapters):
        

        self._ethernet_adapters.clear()
        for _ in range(0, ethernet_adapters):
            self._ethernet_adapters.append(EthernetAdapter(interfaces=4))

        log.info('IOU "{name}" [{id}]: number of Ethernet adapters changed to {adapters}'.format(name=self._name,
                                                                                                 id=self._id,
                                                                                                 adapters=len(self._ethernet_adapters)))

        self._adapters = self._ethernet_adapters + self._serial_adapters
200137
async def connect(self, poll_devices=False, device=None, workdir=None):
        """"""
        await self.aldb_load_lock.acquire()
        device = self.host if self.host else self.device
        _LOGGING.info('Connecting to Insteon Modem at %s', device)
        self.device = device if device else self.device
        self.workdir = workdir if workdir else self.workdir
        conn = await insteonplm.Connection.create(
            device=self.device,
            host=self.host,
            port=self.port,
            username=self.username,
            password=self.password,
            loop=self.loop,
            poll_devices=poll_devices,
            workdir=self.workdir)
        _LOGGING.info('Connecton made to Insteon Modem at %s', device)
        conn.protocol.add_device_callback(self.async_new_device_callback)
        conn.protocol.add_all_link_done_callback(
            self.async_aldb_loaded_callback)
        self.plm = conn.protocol
        await self.aldb_load_lock
        if self.aldb_load_lock.locked():
            self.aldb_load_lock.release()
56916
async def _connect(self, connection_lost_callbk=None):
        """"""
        self.connection_lost_callbk = connection_lost_callbk
        url = self._config['url']
        LOG.info("Connecting to ElkM1 at %s", url)
        scheme, dest, param, ssl_context = parse_url(url)
        conn = partial(Connection, self.loop, self._connected,
                       self._disconnected, self._got_data, self._timeout)
        try:
            if scheme == 'serial':
                await serial_asyncio.create_serial_connection(
                    self.loop, conn, dest, baudrate=param)
            else:
                await asyncio.wait_for(self.loop.create_connection(
                    conn, host=dest, port=param, ssl=ssl_context), timeout=30)
        except (ValueError, OSError, asyncio.TimeoutError) as err:
            LOG.warning("Could not connect to ElkM1 (%s). Retrying in %d seconds",
                        err, self._connection_retry_timer)
            self.loop.call_later(self._connection_retry_timer, self.connect)
            self._connection_retry_timer = 2 * self._connection_retry_timer \
                if self._connection_retry_timer < 32 else 60
785890
def connect(self):
        """"""
        self.sock = socket_create_connection((self.host,self.port),
                                             self.timeout, self.source_address)
        if self._tunnel_host:
            self._tunnel()
775818
def __connect(self):
        """"""
        try:
            logger.debug("Socket connecting to %s:%s", self.host, self.port)
            self.sock.connect((self.host, self.port))
        except socket.error as e:
            logger.exception("socket error %s", e)
            logger.error("Closing socket and recreating a new one.")
            self.sock.close()
            self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.sock.connect((self.host, self.port))
3052
def _get_connection(self, x, y):
        """"""
        if (self._width is None or self._height is None or
                self._root_chip is None):
            return self.connections[None]
        else:
            # If possible, use the local Ethernet connected chip
            eth_chip = spinn5_local_eth_coord(x, y, self._width, self._height,
                                              *self._root_chip)
            conn = self.connections.get(eth_chip)
            if conn is not None:
                return conn
            else:
                # If no connection was available to the local board, choose
                # another arbitrarily.
                # XXX: This choice will cause lots of contention in systems
                # with many missing Ethernet connections.
                return self.connections[None]
1092139
def connect(self, addr):
        """"""
        if _debug: DeviceToDeviceClientService._debug("connect %r", addr)

        # make a connection
        conn = ConnectionState(addr)
        self.multiplexer.connections[addr] = conn

        # associate with this service, but it is not connected until the ack comes back
        conn.service = self

        # keep a list of pending NPDU objects until the ack comes back
        conn.pendingNPDU = []

        # build a service request
        request = ServiceRequest(DEVICE_TO_DEVICE_SERVICE_ID)
        request.pduDestination = addr

        # send it
        self.service_request(request)

        # return the connection object
        return conn
1166147
def connect(self, host: str = '192.168.0.3', port: Union[int, str] = 5555) -> None:
        ''''''
        self.device_sn = f'{host}:{port}'
        if not is_connectable(host, port):
            raise ConnectionError(f'Cannot connect to {self.device_sn}.')
        self._execute('connect', self.device_sn)
1018050
def connect(self):
        """"""
        self.socket = socket.create_connection(self.address, self.timeout)
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)
                )