Set the port
@param int $port
@return sFire\HTTP\Client
484516
public function port($port) {

		if(false === ('-' . intval($port) == '-' . $port)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($port)), E_USER_ERROR);
		}

		if($port < 1 || $port > 65535) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be between 1 and 65535, "%s" given', __METHOD__, $port), E_USER_ERROR);
		}

		$this -> options[CURLOPT_PORT] = intval($port);

		return $this;
	}
1222608
public function setPort(/* integer */ $port) {
		// Close connection before changing port.
		if ($this->port !== $port) {
			$this->close();
			$this->port = $port;
		}
	}
1082955
public function setRequestHandler($handler)
    {
        $this->requestHandler = $handler;

        $this->requestHandler->setUri($this->url)
            ->setMethod($this->method);

        $this->requestHandler->getUri()->setPort($this->port);

        return $this;
    }
941419
protected function filterPort($port)
    {
        if ($port !== null) {
            $port = intval($port);

            if ($port < 1 || $port > 65535) {
                throw new InvalidArgumentException(sprintf('Invalid port "%s".', $port));
            }
        } else {
            $port = null;
        }

        return $port;
    }
946279
protected function filterPort(int $port = null): int
    {
        $port = (int) $port; // Cast null to 0.

        if (0 > $port || 0xffff < $port) {
            throw new InvalidValueException(
                sprintf('Invalid port: %d. Must be 0 or an integer between 1 and 65535.', $port)
            );
        }

        return $port;
    }
1338935
public function setHost($host, $port = null) {
		$this->host = (string) $host;
		
		if ($port !== null) {
			$this->setPort($port);
		}
		
		return $this;
	}
24977
public function port($port = null)
    {
        if (func_num_args() === 1) {
            $this->_port = $port;
            return $this;
        }
        if ($this->_port !== null) {
            return $this->_port;
        }
        $scheme = $this->_classes['scheme'];
        $name = $this->scheme();

        if ($scheme::registered($name)) {
            return $scheme::port($name);
        }
    }
736695
public void setPort(int port)
    {
        if (_address == null || _address.getHostName() == null)
            _address= new InetSocketAddress(port);
        else
            _address= new InetSocketAddress(_address.getHostName(), port);
    }
686711
public function withPort(int $port): UrlInterface
    {
        if (!self::myValidatePort($port, $error)) {
            throw new UrlInvalidArgumentException($error);
        }

        return new self($this->myScheme, $this->myHost, $port, $this->myPath, $this->myQueryString, $this->myFragment);
    }
128012
public function setProxy($host, $port=false)
	{
		$this->options[CURLOPT_PROXY] = $host;

		if ($port) {
			$this->options[CURLOPT_PROXYPORT] = $port;
		}
	}
898462
public function toHttps(int $port = null): self
    {
        if ($this->isHttps()) {
            if (null !== $port && !$this->parsedUri->portEquals($port)) {
                return new ConstructedHttpUri($this->parsedUri->transpose(['port' => $port]));
            }

            return $this;
        }

        $changes = ['scheme' => Http::SCHEME_SSL];
        if ($this->parsedUri->hasPort()) {
            $changes['port'] = $port;
        }

        return new ConstructedHttpUri($this->parsedUri->transpose($changes));
    }
787274
function setPort($port)
    {
        if ($port !== null) {
            if (empty($port) && $port !== 0)
                $port = null;
            elseif ($port < 1 || $port > 65535)
                throw new \InvalidArgumentException(sprintf(
                    'Invalid port "%d" specified; must be a valid TCP/UDP port',
                    $port
                ));
        }

        $this->port = $port;
        return $this;
    }
1072065
public function setPort($port) {
        $this->port = $port;
        if ($this->port < 0 || $this->port > 65535) {
            throw new InvalidArgumentException('connection post is out of range');
        }
        return $this;
    }
631701
public function setPort($port)
    {
        if ($port != $this->_port) {
            $this->_port = (int)$port;
            $this->_hostInfo = null;
        }
        return $this;
    }
222768
public function setGearmanPort(int $port) : void
    {
        if ($port < 1 || $port > 65535) {
            throw new ManagerException('Invalid port number.');
        }
        $this->gearmanPort = $port;
    }
264587
public function setPort($port)
	{
		//Use the provided port or use the default
		$port = (int) $port;

		if ($port <= 0)
		{
			throw new Apache_Solr_InvalidArgumentException('Port is not a valid port number');
		}
		else
		{
			$this->_port = $port;
		}

		if ($this->_urlsInited)
		{
			$this->_initUrls();
		}
	}
1228320
public function setIp($ip, $port = null)
    {
        $this->login = null;
        $this->ip    = (string)$ip;
        if ($port) {
            $this->setPort($port);
        }
        return $this;
    }