Connect to the unix domain socket, which is passed to us as self.host

        This is in host because the format we use for the unix domain socket is:

        http+unix://%2Fpath%2Fto%2Fsocket.sock
511209
def connect(self):
        
        try:
            self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

            if has_timeout(self.timeout):
                self.sock.settimeout(self.timeout)

            self.sock.connect(unquote(self.host))
        except socket.error as msg:
            if self.sock:
                self.sock.close()
            self.sock = None

            raise socket.error(msg)
1254485
def _connect(self):
        ""
        self.socket = socket.socket()
        self.socket.connect((self.config['host'], self.config['port']))
        self.cmd("NICK %s" % self.config['nick'])
        self.cmd("USER %s %s bla :%s" %
                (self.config['ident'], self.config['host'], self.config['realname']))
172404
private SocketChannel connectToHost(SocketAddress hostAddr)
            throws IOException
    {
        SocketChannel socket = null;
        while (socket == null) {
            try {
                socket = SocketChannel.open(hostAddr);
            }
            catch (java.net.ConnectException e) {
                LOG.warn("Joining host failed: " + e.getMessage() + " retrying..");
                try {
                    Thread.sleep(250); //  milliseconds
                }
                catch (InterruptedException dontcare) {}
            }
        }
        return socket;
    }
523323
def connect(self, host, port):
        ''''''
        conn = connection.Connection(host, port,
            reconnection_backoff=self._reconnection_backoff,
            auth_secret=self._auth_secret,
            timeout=self._connect_timeout,
            **self._identify_options)
        if conn.alive():
            conn.setblocking(0)
        self.add(conn)
        return conn
740377
public static UNIXSocket connectTo(UNIXSocketAddress addr) throws IOException {
	UNIXSocket socket = newInstance();
	socket.connect(addr);
	return socket;
    }
892339
def connect(self):
    
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(("127.0.0.1", self._port))
    return sock
982333
def _connect(self):
        
        # we want to mimic what socket.create_connection does to support
        # ipv4/ipv6, but we want to set options prior to calling
        # socket.connect()
        err = None
        for res in socket.getaddrinfo(self.host, self.port, 0,
                                      socket.SOCK_STREAM):
            family, socktype, proto, canonname, socket_address = res
            sock = None
            try:
                sock = socket.socket(family, socktype, proto)
                # TCP_NODELAY
                sock.setsockopt(socket.IPPROTO_TCP,socket.TCP_NODELAY, 1)

                # TCP_KEEPALIVE
                if self.socket_keepalive:
                    sock.setsockopt(socket.SOL_SOCKET,socket.SO_KEEPALIVE, 1)
                    for k, v in iteritems(self.socket_keepalive_options):
                        sock.setsockopt(socket.SOL_TCP, k, v)                

                # set the socket_connect_timeout before we connect
                sock.settimeout(self.socket_connect_timeout)
                # connect
                sock.connect(socket_address)
                # set the socket_timeout now that we're connected
                sock.settimeout(self.socket_timeout)
                return sock                

            except socket.error as _:
                err = _
                if sock is not None:
                    sock.close()
        if err is not None:
            raise err
        raise socket.error("socket.getaddrinfo returned an empty list")
1348435
def _do_connect(self):
        
        self.load_system_host_keys()
        if self.username is None or self.port is None:
            self._configure()
        try:
            self.connect(hostname=self.hostname,
                         port=self.port,
                         username=self.username,
                         key_filename=self.key_filename,
                         sock=self.proxy)
        except socket.error as e:
            raise GerritError("Failed to connect to server: %s" % e)

        try:
            version_string = self._transport.remote_version
            pattern = re.compile(r'^.*GerritCodeReview_([a-z0-9-\.]*) .*$')
            self.remote_version = _extract_version(version_string, pattern)
        except AttributeError:
            self.remote_version = None
520166
def connect(self):
        ""
        family, stype, proto, cname, sockaddr = self.best_connection_params(
            self.host, self.port)
        self.sock = socket.socket(family, stype)
        self.sock.settimeout(self.timeout)
        self.sock.connect(sockaddr)
886258
def connect(self, host, port, name=None):
        
        client = self._clients.get(name)
        client.connect_to(host, port)
1112275
public function connect() {
		mysqli_report(MYSQLI_REPORT_STRICT);
		$settings = parse_url($this->dsn);

		// If we can't even parse the DSN, don't bother
		if (!isset($settings['path']) OR !isset($settings['host']) OR !isset($settings['user'])) {
			throw new \Exception('Could not connect to database: DSN incorrect');
		}

		// We don't support connecting to UNIX sockets the traditional way
		if ($settings['host'] == 'unix(') {
			throw new \Exception('Could not connect to database: UNIX socket syntax is wrong');
		}

		$settings['path'] = substr($settings['path'], 1);
		$this->database = @new \Mysqli($settings['host'], $settings['user'], $settings['pass'], $settings['path']);

		// If there is an error connecting to the database, stop doing what you're doing
		if ($this->database->connect_errno != 0) {
			throw new \Exception('Could not connect to database: ' . $this->database->connect_error);
		}

		$this->database->set_charset('utf8');
		$this->connected = true;
	}
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()
1254895
async def _connect(self, hostname, port, reconnect=False, password=None, encoding=pydle.protocol.DEFAULT_ENCODING, channels=[], tls=False, tls_verify=False, source_address=None):
        
        self.password = password

        # Create connection if we can't reuse it.
        if not reconnect:
            self._autojoin_channels = channels
            self.connection = connection.Connection(hostname, port,
                source_address=source_address,
                tls=tls, tls_verify=tls_verify,
                tls_certificate_file=self.tls_client_cert,
                tls_certificate_keyfile=self.tls_client_cert_key,
                tls_certificate_password=self.tls_client_cert_password,
                eventloop=self.eventloop)
            self.encoding = encoding

        # Connect.
        await self.connection.connect()
958628
async def connect(self, hostname=None, port=None, tls=False, **kwargs):
        
        if not port:
            if tls:
                port = DEFAULT_TLS_PORT
            else:
                port = rfc1459.protocol.DEFAULT_PORT
        return await super().connect(hostname, port, tls=tls, **kwargs)
390430
def connect(alias_name, options)
      file = File.open(FILE_PATH, 'r')
      servers = all_hosts_in(file)
      if servers.include?alias_name
        PRINTER.verbose_print "Connecting to #{alias_name}"
        exec "ssh #{alias_name}"
      else
        PRINTER.print "Could not find host `#{alias_name}`"
      end
    end
648118
private function connect()
    {
        if (!$this->_sock) {
            if ($this->_persistentSocket) {
                $this->_sock = pfsockopen($this->_host, $this->_port, $errno, $errstr, $this->_connectTimeout/1000);
            } else {
                $this->_sock = fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_connectTimeout/1000);
            }

            if (!$this->_sock) {
                throw new \Exception('Unable to connect to FastCGI application: ' . $errstr);
            }

            if (!$this->set_ms_timeout($this->_readWriteTimeout)) {
                throw new \Exception('Unable to set timeout on socket');
            }
        }
    }
787130
def connect_to_unix(params)
      @socket = Socket.new(Socket::Constants::PF_UNIX, Socket::Constants::SOCK_STREAM, 0)
      @socket.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
      if !params["abstract"].nil?
        sockaddr = if HOST_END == LIL_END
                     "\1\0\0#{params["abstract"]}"
                   else
                     "\0\1\0#{params["abstract"]}"
                   end
      elsif !params["path"].nil?
        sockaddr = Socket.pack_sockaddr_un(params["path"])
      end
      @socket.connect(sockaddr)
      init_connection
    end