mirror of
https://github.com/predis/predis.git
synced 2026-09-04 14:56:47 +00:00
Co-authored-by: Ondřej Ešler <ondrej.esler@peoplepath.com>
This commit is contained in:
@@ -123,8 +123,9 @@ class PhpiredisStreamConnection extends StreamConnection
|
||||
{
|
||||
$socket = null;
|
||||
$timeout = (isset($parameters->timeout) ? (float) $parameters->timeout : 5.0);
|
||||
$context = stream_context_create();
|
||||
|
||||
$resource = @stream_socket_client($address, $errno, $errstr, $timeout, $flags);
|
||||
$resource = @stream_socket_client($address, $errno, $errstr, $timeout, $flags, $context);
|
||||
|
||||
if (!$resource) {
|
||||
$this->onConnectionError(trim($errstr), $errno);
|
||||
|
||||
@@ -123,8 +123,9 @@ class StreamConnection extends AbstractConnection
|
||||
protected function createStreamSocket(ParametersInterface $parameters, $address, $flags)
|
||||
{
|
||||
$timeout = (isset($parameters->timeout) ? (float) $parameters->timeout : 5.0);
|
||||
$context = stream_context_create();
|
||||
|
||||
if (!$resource = @stream_socket_client($address, $errno, $errstr, $timeout, $flags)) {
|
||||
if (!$resource = @stream_socket_client($address, $errno, $errstr, $timeout, $flags, $context)) {
|
||||
$this->onConnectionError(trim($errstr), $errno);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user