Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context::background() does not work #8

Open
jakubkulhan opened this issue Feb 19, 2018 · 1 comment
Open

Context::background() does not work #8

jakubkulhan opened this issue Feb 19, 2018 · 1 comment

Comments

@jakubkulhan
Copy link
Owner

This always fails:

$ctx = Context::background();
$instance->createSession($ctx);

Context::background() has deadline null - it sets stream_set_timeout() to 0. Seems that http://php.net/manual/en/function.stream-set-timeout.php does not clear timeout, when setting to zero, but instead times out socket immediately.

@pauloacosta
Copy link

pauloacosta commented Sep 19, 2020

This is probably the cause of the error I'm getting:

Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: cURL error 28: Connection timed out after 1315 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\xampp\htdocs\chrome\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:200 Stack trace: #0 C:\xampp\htdocs\chrome\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection(Object(GuzzleHttp\Handler\EasyHandle), Array) #1 C:\xampp\htdocs\chrome\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #2 C:\xampp\htdocs\chrome\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish(Object(GuzzleHttp\Handler\CurlHandler), Object(GuzzleHttp\Handler\EasyHandle), Object(GuzzleHttp\Handler\CurlFactory)) #3 C:\xampp\htdocs\chrome\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handl in C:\xampp\htdocs\chrome\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 200

My Code:

// context creates deadline for operations
$ctx = Context::withTimeout(Context::background(), 60 /* seconds */);

// launcher starts chrome process ($instance)
$launcher = new Launcher();
$launcher->setExecutable('C:\Program Files (x86)\Google\Chrome\Application');
$instance = $launcher->launch($ctx);

Any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants