lithium\tests\cases\data\ConnectionsTest::_canConnect PHP Method

_canConnect() protected method

protected _canConnect ( $host, $port )
    protected function _canConnect($host, $port)
    {
        $success = false;
        set_error_handler(function () {
        });
        if ($conn = fsockopen($host, $port)) {
            fclose($conn);
            $success = true;
        }
        restore_error_handler();
        return $success;
    }