Connect to a S7 server.

        :param address: IP address of server
        :param rack: rack on server
        :param slot: slot on server.
166317
def connect(self, address, rack, slot, tcpport=102):
        
        logger.info("connecting to %s:%s rack %s slot %s" % (address, tcpport,
                                                             rack, slot))

        self.set_param(snap7.snap7types.RemotePort, tcpport)
        return self.library.Cli_ConnectTo(
            self.pointer, c_char_p(six.b(address)),
            c_int(rack), c_int(slot))
644598
def connect(self, signalName, slot):
        
        assert signalName in self, "%s is not a registered signal" % signalName
        self[signalName].connect(slot)
1146530
def start(self):
        '''
        
        '''
        if ':' in self.address:
            self.skt = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
        else:
            self.skt = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        if self.reuse_port:
            self.skt.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
            if hasattr(socket, 'SO_REUSEPORT'):
                self.skt.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
            else:
                log.error('SO_REUSEPORT not supported')
        try:
            self.skt.bind((self.address, int(self.port)))
        except socket.error as msg:
            error_string = 'Unable to bind to port {} on {}: {}'.format(self.port, self.address, msg)
            log.error(error_string, exc_info=True)
            raise BindException(error_string)
697836
def _connect(self, servers):
        
        self._do_connect(servers.split(' '))
        self._verify_connection(verbose=True)
280210
def connect(sock, addr):
    """"""
    try:
        sock.connect(addr)
    except ssl.SSLError as e:
        return (ssl.SSLError, e.strerror if e.strerror else e.message)
    except socket.herror as (_, msg):
        return (socket.herror, msg)
    except socket.gaierror as (_, msg):
        return (socket.gaierror, msg)
    except socket.timeout:
        return (socket.timeout, "timeout")
    except socket.error as e:
        return (socket.error, e.strerror if e.strerror else e.message)
    
    return None
914587
async def connect(self):
        

        if isinstance(self.connection, dict):
            # a dict like {'host': 'localhost', 'port': 6379,
            #              'db': 0, 'password': 'pass'}
            kwargs = self.connection.copy()
            address = (
                kwargs.pop('host', 'localhost'),
                kwargs.pop('port', 6379)
            )
            redis_kwargs = kwargs
        elif isinstance(self.connection, aioredis.Redis):
            self._pool = self.connection
        else:
            # a tuple or list ('localhost', 6379)
            # a string "redis://host:6379/0?encoding=utf-8" or
            # a unix domain socket path "/path/to/redis.sock"
            address = self.connection
            redis_kwargs = {}

        if self._pool is None:
            async with self._lock:
                if self._pool is None:
                    self.log.debug('Connecting %s', repr(self))
                    self._pool = await self._create_redis_pool(
                        address, **redis_kwargs,
                        minsize=1, maxsize=100)

        return await self._pool
279303
def connect(self, host='localhost'):
        

        # Connect

        get_logger().info("Connecting to RabbitMQ server...")

        self._conn = pika.BlockingConnection(
            pika.ConnectionParameters(host=host))
        self._channel = self._conn.channel()

        # Exchanger

        get_logger().info("Declaring topic exchanger {}...".format(
            self.exchange))

        self._channel.exchange_declare(exchange=self.exchange, type='topic')

        # Create queue

        get_logger().info("Creating RabbitMQ queue...")
        result = self._channel.queue_declare(exclusive=True)

        self._queue_name = result.method.queue

        # Binding

        if self.listen_all:
            get_logger().info(
                "Binding queue to exchanger {} (listen all)...".format(
                    self.exchange
                )
            )
            self._channel.queue_bind(
                exchange=self.exchange,
                queue=self._queue_name,
                routing_key='*'
            )
        else:
            for routing_key in self.topics:
                get_logger().info(
                    "Binding queue to exchanger {} "
                    "with routing key {}...".format(
                        self.exchange, routing_key)
                )

                self._channel.queue_bind(
                    exchange=self.exchange,
                    queue=self._queue_name,
                    routing_key=routing_key
                )

        # Callback

        get_logger().info("Binding callback...")
        self._channel.basic_consume(
            self._callback, queue=self._queue_name, no_ack=True)
892339
def connect(self):
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(("127.0.0.1", self._port))
    return sock
610855
def connect_hostport(hostport, timeout=RPC_DEFAULT_TIMEOUT, my_hostport=None):
    
    host, port = url_to_host_port(hostport)

    assert host is not None and port is not None

    protocol = url_protocol(hostport)
    if protocol is None:
        log.warning("No scheme given in {}. Guessing by port number".format(hostport))
        if port == RPC_SERVER_PORT or port == RPC_SERVER_TEST_PORT:
            protocol = 'http'
        else:
            protocol = 'https'

    proxy = BlockstackRPCClient(host, port, timeout=timeout, src=my_hostport, protocol=protocol)
    return proxy
664688
def create_host(resource_root, host_id, name, ipaddr, rack_id=None):
  
  apihost = ApiHost(resource_root, host_id, name, ipaddr, rack_id)
  return call(resource_root.post, HOSTS_PATH, ApiHost, True, data=[apihost])[0]
499203
def connect(self):
        
        self.client = redis.Redis(
            host=self.host, port=self.port, password=self.password)
388971
def connectPeer(self, peer):
        
        return self.conns.connectCached(endpoint.Q2QEndpoint(self.svc,
                                                             self.addr,
                                                             peer,
                                                             PROTOCOL_NAME),
                                        self.clientFactory)
229276
def _connect(self):
        
        if self is None:
            return
        comm('connecting to 127.0.0.1:%d', self._port)
        address = QtNetwork.QHostAddress('127.0.0.1')
        self.connectToHost(address, self._port)
        if sys.platform == 'darwin':
            self.waitForConnected()
1018050
def connect(self):
        """"""
        self.socket = socket.create_connection(self.address, self.timeout)
53493
def connect(self, slot):
        
        self._ensure_slot_args(slot)
        if not self.is_connected(slot):
            self.slots.append(slot)
1211962
def connect(self):
        
        self.con = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.con.connect((self.ip, self.port))

        log.debug('Connected with set-top box at %s:%s.',
                  self.ip, self.port)
487197
def _connect(host=DEFAULT_HOST, port=DEFAULT_PORT):
    '''
    
    '''
    if six.text_type(port).isdigit():
        return memcache.Client(['{0}:{1}'.format(host, port)], debug=0)
    raise SaltInvocationError('port must be an integer')