-
Notifications
You must be signed in to change notification settings - Fork 12
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
Not receive a response until a timeout is reached #2
Comments
Please show your codes or give an example to reproduce the issue.
https://tools.ietf.org/html/rfc2616#section-4.3 According to the RFC specification, 201 and 401 do include a |
Example: <?php
require __DIR__ . '/vendor/autoload.php';
use Workerman\Http\Client;
use Workerman\Worker;
$worker = new Worker();
$worker->count = 1;
$worker->onWorkerStart = function () {
$http_async_client = new Client( [
'connect_timeout' => 10,
'timeout' => 10,
] );
$start_time = microtime( true );
$http_async_client->get(
"https://apip.orangedata.ru:2443/api/v2/devices/status/12345678910/Main",
function () use ( $start_time ) {
echo 'Elapsed time ' . round( microtime( true ) - $start_time, 2 ). ' sec';
}
);
};
Worker::runAll(); Output: |
Please upgrade to v0.1.6. |
Great, it works! There is another issue. In the current implementation, it is not possible to set SSL certificates. protected function create($address, $ssl = false)
{
$context = [];
if ( !empty( $this->_option['context'] ) ) {
$context = $this->_option['context'];
}
$connection = new AsyncTcpConnection($address, $context);
...
} $custom_http_client = new Client( [
'connect_timeout' => 10,
'timeout' => 10,
'context' => [
'ssl' => [
'local_cert' => $this->client_crt_path,
'local_pk' => $this->client_key_path,
],
],
] ); What about native support? |
Please upgrade again. |
Awesome! Thank you! |
Hello!
When I make a request, I don't receive a response until a timeout is reached. In Request.php, function checkComplete waits the connection to be closed if empty Content-Length. Why? For responses with a code of 200 and not empty response body everything works correctly, but if the answer is 401 or 201 with empty body, we are waiting for the closing.
The text was updated successfully, but these errors were encountered: