@param null|string $host
@param int|null    $port
@param int|null    $ttlDefault
@param int|null    $ttlMax
@param int|null    $ttlTags
@param bool|null   $useTagsBuffer

@throws \Exception
498593
public static function Init(?string $host = null, ?int $port = null, ?int $ttlDefault = null, ?int $ttlMax = null, ?int $ttlTags = null, ?bool $useTagsBuffer = null) :void
        {
            if (!self::IsSupported()) {
                throw new \Exception('Memcache is not supported!');
            }

            if (self::$inited) {
                return;
            }

            self::$inited = true;

            self::$host = is_null($host) ? Cfg::Get('Vxn.cache.memcache.host') : $host;
            self::$port = is_null($port) ? Cfg::Get('Vxn.cache.memcache.port') : $port;

            self::$ttlDefault    = is_null($ttlDefault) ? Cfg::Get('Vxn.cache.memcache.ttl.default') : $ttlDefault;
            self::$ttlMax        = is_null($ttlMax) ? Cfg::Get('Vxn.cache.memcache.ttl.max') : $ttlMax;
            self::$ttlTags       = is_null($ttlTags) ? Cfg::Get('Vxn.cache.memcache.ttl.tags') : $ttlTags;
            self::$useTagsBuffer = is_null($useTagsBuffer) ? Cfg::Get('Vxn.cache.memcache.useTagsBuffer') : $useTagsBuffer;

            Engine::RegisterFinalShutdown(function () {
                self::CloseConnection();
            });
        }
1312785
public function setConnectionParam($host, $username, $password, $database = null, $port = null,  $settingList = [])
    {
        parent::setConnectionParam($host, $username, $password, $database, $port,  $settingList);

        // if there is no port set the default port
        if (!$this->getPort() && !$port) {
            $this->setPort(self::MYSQL_DEFAULT_PORT);
        }
    }
302953
public void setHost(String host)
        throws java.net.UnknownHostException
    {
        _addr=null;
        if (host!=null)
        {
            if (host.indexOf('/')>0)
                host=host.substring(0,host.indexOf('/'));
            _addrIsHost=!Character.isDigit((host.charAt(0)));
            _addr=InetAddress.getByName(host);
        }
    }
30795
public function connect($host = null, $port = null)
    {
        $this->_host = null !== $host ? $host : $this->_host;
        $this->_port = null !== $port ? $port : $this->_port;
        if (false === $this->_ssh_resource = ssh2_connect($this->_host, $this->_port)) {
            throw new TransportException(sprintf('Enable to connect to %s:%i.', $this->_host, $this->_port));
        }

        return $this;
    }
1345809
private static function isStandardPort($port, $scheme = null, $host = null)
    {
        if ($host === null || $scheme === null) {
            return false;
        }

        return array_key_exists($scheme, static::$schemes) && $port === static::$schemes[$scheme];
    }
1348747
public function setProxy($host = null, $port = null)
    {
        parent::setProxy($host, $port);

        if ($this->curl) {
            if ($this->proxyHost) {
                curl_setopt($this->curl, CURLOPT_PROXY, $this->proxyHost);
                curl_setopt($this->curl, CURLOPT_PROXYPORT, $this->proxyPort);
            } else {
                curl_setopt($this->curl, CURLOPT_PROXY, '');
            }
        }
    }
723714
protected function checkConnection($host, $port)
    {
        $host = ($port == 443) ? 'ssl://' . $host : 'tcp://' . $host;

        // If the connection could not be established, fsockopen sadly does not
        // only return false (as documented), but also always issues a warning.
        if (($this->connection === null) &&
            (($this->connection = @stream_socket_client($host . ':' . $port, $errno, $errstr)) === false)) {
            // This is a bit hackisch...
            $this->connection = null;
            throw new \RuntimeException('fail');
        }
    }
28564
public function setHost(Host $host)
    {
        $this->host = $host;

        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker host after worker has started working');
        }
    }
570294
public function setHost($host)
    {
        if (preg_match(self::PATTERN_MATCH_HOST, $host) !== 1) {
            throw new \InvalidArgumentException('"' . $host . '" is not valid host as part of a URI.', 1184071240);
        }

        $this->host = $host;
    }
906557
public function disconnectFromNSQD($host, $port)
    {
        $key = "$host:$port";
        if (!isset($this->nsqdTCPAddrsConnNum[$key])) {
            throw new NsqException("not connected");
        }

        foreach ($this->getConnections() as $conn) {
            if ($conn->getHost() === $host && $conn->getPort() === $port) {
                $conn->tryClose();
            }
        }
        $this->nsqdTCPAddrsConnNum[$key] = 0;
    }
111781
public void setHttpProxy(String host, int port) {
        if (config == null) {
            config = new AipClientConfiguration();
        }
        this.config.setProxy(host, port, Proxy.Type.HTTP);
    }
350529
protected function getPorts($host = null)
    {
        $ports = $this->ports();
        array_walk($ports, function (&$port) use ($host) {
            $host = isset($host) ? $host : $port;
            $port = "{$host}:{$port}";
        });

        return $ports;
    }
598658
private String buildUrlName(final String host, final String port) {
        try {
            return "tango://" + TangoUrl.getCanonicalName(host) + ":" + port;
        }
        catch (DevFailed e) {
    		return "tango://" + host + ":" + port;
        }
    }
1343526
public void setHttpsProxy(String host) {
    setProxyValue(HTTPS_SERVER, host);
    setProxyValue(USE_HTTPS, host != null);
  }
949107
protected function _validateSftpSettings($host, $username, $key, $port)
    {
        $invalidSettings = [];
        if ($host === '') {
            $invalidSettings[] = 'Remote Host';
        }
        if ($username === '') {
            $invalidSettings[] = 'SFTP User Name';
        }
        if ($key === '') {
            $invalidSettings[] = 'Private Key';
        }
        // valid port would be int between 1 and 65535
        if ((int) $port < 1 || (int) $port > 65535) {
            $invalidSettings[] = 'Remote Port';
        }
        if (!empty($invalidSettings)) {
            throw new Radial_Core_Exception_Sftp_Configuration(
                $this->_helper->__(self::INVALID_SFTP_SETTINGS_ERROR_MESSAGE, implode(', ', $invalidSettings))
            );
        }
        return $this;
    }
880921
public static function isPortOpen($host, $port, $protocol)
    {
        $protocol = strtolower($protocol);
        
        if ($protocol != 'tcp' && $protocol != 'udp')
        {
            $errMsg = 'Unrecognized protocol [' . $protocol . '] ' . 
                      'please specify [tcp] or [udp]';
            throw new \Exception($errMsg);
        }
        
        if (empty($host))
        {
            $host = self::getPublicIp();
        }

        foreach ($ports as $port)
        {
            $connection = @fsockopen($host, $port);

            if (is_resource($connection))
            {
                $isOpen = true;
                fclose($connection);
            }

            else
            {
                $isOpen = false;
            }
        }
        
        return $isOpen;
    }
63797
public function setPeername($host, $port)
    {
        $this->host = $host;
        $this->port = $port;
        $this->addr = '[' . $this->host . ']:' . $this->port;
        if ($this->pool->allowedClients !== null) {
            if (!TCP::netMatch($this->pool->allowedClients, $this->host)) {
                Daemon::log('Connection is not allowed (' . $this->host . ')');
                $this->ready = false;
                $this->finish();
            }
        }
    }