Acacha\Llum\Traits\Serve::check_port PHP Method

check_port() protected method

Check if port is in use.
protected check_port ( integer $port = 8000, string $host = '127.0.0.1', integer $timeout = 3 ) : boolean
$port integer
$host string
$timeout integer
return boolean
    protected function check_port($port = 8000, $host = '127.0.0.1', $timeout = 3)
    {
        $fp = @fsockopen($host, $port, $errno, $errstr, $timeout);
        if (!$fp) {
            return true;
        } else {
            fclose($fp);
            return false;
        }
    }